User (Old forums)MemberApril 10, 2007 at 6:41 pmPost count: 23064
I’m having trouble “refreshing” an instance of the datagrid. The first time I bind to a dataset, it works great, I can see the exact dataset I was expecting.
But the second time I bind to a new dataset, the same data continues to be displayed on the datagrid. I am sure the new dataset is different than the previous; I run the stored procedure on the server that returns the data and can clearly see different results (different data in my dataset) and I also placed a breakpoint on the client and inspected the dataset.
Here’s the code I’m using to bind:
MyDataGrid.ItemsSource = MyWebServiceResponse.ResultDataSet.Tables(0).DefaultView
Is this a bug or is there something else I should be doing for the datagrid to display the correct data? I upgraded today to the latest datagrid (Xceed.Wpf.DataGrid.dll 1.0.7170.16090).
Imported from legacy forums. Posted by Emmanuel (had 3388 views)Xceed SupportMemberApril 11, 2007 at 9:16 amPost count: 5658
This is a bug that was already identified and fixed… Unfortunately, the fix did not make it in time for the latest build.
The fix can be expected “soon” ( We already mentioned that we are targeting beginning of May ).
Imported from legacy forums. Posted by Marcus [Xceed] (had 368 views)User (Old forums)MemberApril 11, 2007 at 3:09 pmPost count: 23064
Thanks for letting me know. Is there any workaround? I tried created a new instance of the datagridcontrol but that didn’t work. Is there anything I could do to make this work until the fix comes out in May?
Imported from legacy forums. Posted by Emmanuel (had 259 views)User (Old forums)MemberApril 12, 2007 at 7:44 amPost count: 23064
we have one solution for your problem
create the datagrid columns on the serverside and bind them there itself, donot create the grid columns on design page, if so you wont see the effected results when you rebind
when ever you want to rebind the data you need to clear all the grid columns and again you need to do the samething mentioned above
Imported from legacy forums. Posted by Suresh (had 559 views)User (Old forums)MemberApril 12, 2007 at 2:38 pmPost count: 23064
That worked, THANKS!
I was already creating the dataset on the server side and binding it to the datagridcontrol, so your response got me thinking. After stepping in through the code I found that this line:
was actually raising an exception (telling me I cannot change the items (but that I should instead change the underlying itemsource).
The problem was that I was catching the exception and not displaying it to the user. Once I removed the above line, the refreshing of the itemsource actually worked great.
Imported from legacy forums. Posted by Emmanuel (had 5187 views)
- You must be logged in to reply to this topic.