User Profile & Activity

Shawn August Member
Page
of 19
Posted: September 3, 2010 1:39 PM

Hi Shawn,


I can't replicate your issue, My CellTemplate WebGrid can show an image just fine.

Would you mind to send me your sample and let me try yours on my side?


Thank you.

Have a nice day.


Best regards,

Niven Prasetya

 

Sorry for the delay. I was away on vacation.

 

Can you show me your example. I am simple trigger off a button click and using the RootTable's NewRow() method and then setting some default data and then the Row's AddPendingChanges method to display it.

I understand now. I had to set the ImagesDirectory which can use the tilda otherwise it defaults to the CommonLibrary directory. Thank you.

Please allow me to explain how SmartWebResources™ works.

Each of Intersoft’s product has their own resources such as scripts and images. For instance, previously these resources are stored in “/CommonLibrary/Shared” folder for core framework resources. WebGrid’s resources are stored in “/CommonLibrary/WebGrid/v7_0_7200” folder.

With SmartWebResources, they are now embedded into .NET assembly. SmartWebResources™ stores each product’s client resources in separate assembly.

When you are using SmartWebResources™, by default, all of the product resources (scripts and images), in this case the product is WebDesktop, will be loaded from ISNet.WebUI.WebDesktop.Resources.dll assembly file.

Should you need to have your WebDesktop showing your own custom images by defining the relative path within the ‘ImageSettings’ path, please try set the value of “EnableWebResources” property to “ScriptOnly”. By using this setting, only script that will be obtained from WebDesktop resource assembly file. You can either setting this on your specific page of your WebDesktop instance as shown in the snippet code below

<ISWebDesktop:WebDesktopManager ID="WebDesktopManager1" runat="server" Height="100%"
    Width="100%" ActiveWindowIndex="0" EnableWebResources="ScriptOnly">
    <ImagesSettings CloseActive="~/Images/dot.gif" />
    ...
</ISWebDesktop:WebDesktopManager>

or specify it to entire web application without has to change the value to each control’s instance. Please insert following snippet code into <appSettings> of web.config file.

<appSettings>
  <add key="ISNet.WebUI.WebDesktop.v3_0_7200.EnableWebResources" value="ScriptOnly"/>
</appSettings>

Hope this helps.

 

I still don't understand why this isn't possible. The application uses SmartWebResources for the majority of the controls. I can use custom images similiar to my original post in this thread to specify the pathway to the images. This will work fine unless you want to put this markup in a user control that can be put on pages in various pathways where the relative paths won't be correct.  This is why I want to use the tilda like other ASP server-side controls so that the pathway is properly determined.

The axd file shows that your current project is using SmartWebResources™. In order to use the tilde character to specify relative path of image file, please try to use it on a project that doesn’t use SmartWebResources™.

For more detail information about ‘How does SmartWebResources™ work’, please check following link.

Hope this helps.

 

I am confused. We are using SmartWebResources to avoid dealing with CSS/JS files. I like the fact that they are handling by Intersoft. With that said, we want to be able to specify other images using pathways. Does that mean if using SmartWebResources that the TILDE is not available?

I made a simple test by using WebDesktopManager control and set its CloseActive image to “~/Pictures/dot.gif”. The Pictures folder is located right one level under the root of my project.

My simple test shows that we can use the tilde character (“~”) to specify relative path within the WebDesktop’s ImageSettings. I enclosed my simple project to be evaluated. Please let me know if there is anything that I missed during my attempt to repro your issue.

 

I used Fiddler and when I use the tilde character ("~"), it looks for the resources within the AXD file. This isn't the case when I just specify a path without the tilde.

Anyone?

Hi Shawn,

     If we do not include Global.asax, the session is not enabled automatically. That is why the InitializeDataSource is being called twice. I hope it helps. Thank you and have a nice day.

Best Regards,

Andi Santoso

 

 

This makes sense but my application already had a Global.asax that was working properly. Oddly, I removed/re-added it and the event is firing only once.  Not sure why but it's fixed.

 

Thank you.

Hi Shawn,

     It is weird then, I am having a problem to replicate the issue of yours. At first try, it is true that the OnInitializeDataSource is being called twice when I refreshed the grid from client side. However, when I added "Global.asax" file in my project, the OnInitializeDataSource is only being called once.

     Is it possible to provide me with your Global.asax for me to investigate them? Or perhaps, you can try to create a new project with only one file in it. Summon WebGrid and try to do the exact scenario with an empty Global.asax in your project, see if that event is being called twice or once.

     Thank you and have a nice day.

Best Regards,

Andi Santoso

 

 

Nice find! I re-added the Global.asax file and it stopped firing twice. *REALLY* odd. If you re-remove it, does it happen again for you? I wonder what is causing this.

Hi Shawn,

     Please ensure that you have add the "Global.asax" file in your root project. If we do not define the file, the ASP.NET page framwork assumes that we have not defined any application or session event handlers. You can right click on your root project, create a new file of Global.asax and just leave it blank.

     In new Visual Studio 2010, I believe that, this file, "Global.asax" will be automatically included everytime we have created a new project.

      I hope it helps. Thank you and have a nice day.

Best Regards,

Andi Santoso.

 

That file does exist and is widely used for global error handling. I am not sure how this will cause the WebGrid's OnInitializeDataSource event to fire twice when the client-side WebGrid's refresh method is called?

Hi Shawn,

    Unfortunately, using WebValue List, the WebGrid itself has to be bound to DataSource, since on declaring the WebValue List we used DataValueField to connect to the WebGrid itself. So like I mentioned before, using unBound grid and WebValue List is simply conflicting with the nature of the databinding concept. So it is not meant to be used that way.

    I hope it helps. Thank you and have a nice day.

Best Regards,

Andi Santoso 

 

 

I found a weird issue that I can only duplicate with this grid where the WebGrid's

OnInitializeDataSource event goes off twice whenever the grid is refreshed from the client-side. Can you confirm? If not, what else would cause this event to go off twice?

OnInitializeDataSource event goes off twice whenever the grid is refreshed from the client-side. Can you confirm? If not, what else would cause this event to go off twice?

While in BatchUpdate mode, footer would not be updated until you accept all the changes. Your approach can be used as references for the others who also used BatchUpdate mode. We are really appreciate for your post.

Regards,
Handy

 

No problem. I am glad to help given the help I have received.

 

This is working good except filtering does not work. Is there any way for filtering to work with the data entered on the client-side? It won't filter against any of the updated cells.

All times are GMT -5. The time now is 8:56 PM.
Previous Next