Hello All,
I started working with WindGrid for 2 weeks now and was wondering if we can assign a WinGrid to a new Datasource inside a BeforeRowExpanded event? It does not work for me when I tried this.
I have a Wingrid for which a row event should display new data on the grid and for this, I set the datasource property to a new dataset inside the BeforeRowExpanded event.
Please help.
Thank You!
Stacy.
Hi,
I'm afraid I am still confused. Let me see if I have this right...
You are saying that in the BeforeRowExpanded event of the grid, you are setting the grid's DataSource to a completely new data source (I assume a DataTable or DataSet). But that you are still seeing the original data instead of the new data?
I don't see how that can possibly be the case. If you apply a new DataSource to the grid, it cannot be holding on to the old data.The entire grid should be cleared and only the new DataSource should be displayed.
Can you provide a small sample project which demonstrates this behavior?
Hi Mike,
I have a new dataset on the row click event so I set the grid to that dataset by using datasource property. That is the only way to update that row dynamically. It does not show that new dataset which is a subset of the original dataset. Now all i see is the originial dataset only. Do i need to reset/refresh the grid before setting it to the new dataset?
Hi Stacy,
What exactly doesn't work? Are you getting an error?
I must admit, setting the DataSource of the grid to a new DataSource inside the BeforeRowExpanded event doesn't make a whole lot of sense to me. If the user clicks on an expansion indicator, he's probably not expecting all of the grid data to disappear and be replaced by a whole new set of data. I assume you are showing a MessageBox or some kind of prompt dialog, but even so, I can't see why you would want to do that.