Hi,
Can anyone tell me how to refresh a grid which is being populated by using InitializeDataSource?
I've used LoadOnDemand="xml" and trying to bind my grid in a method which I am calling in InitializeDataSource. But, when some action is taken on the screen, I need to refresh the grid for which I tried calling my method to bind the grid again. It's not working. I even tried explicity calling InitializeDataSource which didn't work.
I really need the refresh feature to work according to the requirements. Can someone please help me with some ideas here?
Thanks,
Kala
I would like to follow this case. I am having a very similar problem. I am actually using Online Chat right now to try and find the solution.
I am using a SqlDataSource and I have a grid with multiple columns. I have an "Add New Row" button that allows the end user to add a new empty row into the database. The row is being added to the Sql Database with no problems. Once the row is added, I need the grid to "refresh/databind" and show the new blank row. I tried calling uwgMyWebGrid.Databind from the code-behind, but it does not show the new rows in the grid. If I reload/refresh the webpage, then the new rows appear.
Is there any update on this?
Thank you,Wendi
Thank you!
I did that...Here is the case number: CAS-34250-JJP82D
Please see if you can expedite the process.
Cheers,
Based on this information, it will take further research to determine why this is working as you've described.
Can you reproduce this behavior in an isolated sample that we can run and debug? If so, please submit a support request and attach your sample to it. A Developer Support Engineer will use your sample to research this issue in-depth and work with you to find a resolution.
I've a method InitializeWebGrid() in which I am populating a dataset and setting the datasource of the grid as this dataset. I am calling this method in InitializeDataSource event. I am not calling DataBind() as part of this.
Now, as you told, I tried to opulate the dataset, set it as datasrouce and explicitly call DataBind() once my processing is done. It didn't help. Nothing happens. Simply my process runs and the grid stays as it is without getting refreshed.
Is there any other way to achieve this?
Kala,
When you cause a postback, the grid should be automatically refreshing itself, in this scenario. This occurs very early in the page lifecycle, after Init and before Load and most other events.
If you need to refresh the grid's contents later, such as after processing further events, load the current data into your data source (if you don't already have it) and call the grid's DataBind() method.
As a note, you don't need to (and shouldn't) call DataBind() as part of the grid's InitializeLayout event. When you handle this event, the grid will implicitly call DataBind() when the event has completed.