This is a migrated thread and some comments may be shown as answers.

[Solved] Binding different dataTables to same RadGrid

1 Answer 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Harish
Top achievements
Rank 1
Harish asked on 26 Jan 2011, 10:42 AM
I have a RadGrid (silverlight control) and a combobox on my xaml page. Based on what value I select in the combobox, WCF returns the data and I set it as the ItemSource of the RadGrid. I am using DataTable to bind the data to the grid.
 
public partial class Report: Page
   {
       private DataTable resultData;
       .
       .   
 
       void proxy_GetDataCompleted(object sender, EventArgs e)
       {               
            resultData = new DataTable(e.Result);                
            webGridView.ItemSource = resultData;               
       }       

Now everytime I change the selection on the combobox, I do get different datasource from the WCF service (dataset has different columns) and even the data is bound correctly on the UI. For the first time the data is bound, I do see a valid count in webGridView.Columns, however for subsequent databindings, the data seems nicely bound on the grid/UI but the count on webGridView.Columns is 0 and I cannot access each of the columns. Why does this happen and how do I fix it?

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 27 Jan 2011, 02:47 PM
Hi Harish,

What kind of DataTable are you using ?

Regards,
Pavel Pavlov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Harish
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or