This question is locked. New answers and comments are not allowed.
Hi,
I have 3 RadTabItem on a navigation page that each has a GridView in it.
Let's say that RadTabItem A has GridView A, and so on.
The data for the gridviews are populated from web service on Loaded event and then set to each GridViews.
RadTabItem A is the first tab to appear on the page and I can set the value for GridViewA.SelectedItem from code behind.
This works as expected, but when I set the GridViewB.SelectedItem for RadTabItem B, it will always be set to null.
I've made sure that the itemssource has value & assigned to GridViewB (I can see the content of GridView B when RadTabItem B is selected but can't see the selectedItem on it).
If I select RadTabItem C and go back to RadTabItem B, then I can the selectedItem on GridView B.
Code snippet:
When I set the RadTabItem B as the selected Tab on first load, this works for GridView B (I can see the highlighted selectedItem) but the other tab don't seem to have selectedItem on their respective GridView when I click on RadTabItem A or C.
Is it not possible to set selectedItem for GridView on the tab that is not selected?
If it is, then how come when I click on Tab B, the selectedItems for GridView B is still null? (I've tried to re-set the selectedItem during RadTabControl_SelectionChanged event as well).
I did a trace and it seems GridView B.HasItems is set to true after RadTabItem C is selected (selection changed) eventhough I've set the ItemsSource for each GridView on first load.
The flow would be RadTabItem A (default 1st load) -> RadTabItem B (no SelectedItems on GridView B) -> RadTabItem C (right now I can see that GridViewB.HasItems is set to true) -> RadTabItem B (I can now see the selectedItem for GridView B)
I may be doing something wrong here but not sure where.
I have 3 RadTabItem on a navigation page that each has a GridView in it.
Let's say that RadTabItem A has GridView A, and so on.
The data for the gridviews are populated from web service on Loaded event and then set to each GridViews.
RadTabItem A is the first tab to appear on the page and I can set the value for GridViewA.SelectedItem from code behind.
This works as expected, but when I set the GridViewB.SelectedItem for RadTabItem B, it will always be set to null.
I've made sure that the itemssource has value & assigned to GridViewB (I can see the content of GridView B when RadTabItem B is selected but can't see the selectedItem on it).
If I select RadTabItem C and go back to RadTabItem B, then I can the selectedItem on GridView B.
Code snippet:
<telerik:RadTabControl> <telerik:RadTabItem x:Name="RadTabItemA"> <telerik:RadTabItem.Content> <telerik:RadGridView x:Name="RadGridViewA"> </telerik:RadGridView> </telerik:RadTabItem.Content> </telerik:RadTabItem> <telerik:RadTabItem x:Name="RadTabItemB"> <telerik:RadTabItem.Content> <telerik:RadGridView x:Name="RadGridViewB"> </telerik:RadGridView> </telerik:RadTabItem.Content> </telerik:RadTabItem> <telerik:RadTabItem x:Name="RadTabItemC"> <telerik:RadTabItem.Content> <telerik:RadGridView x:Name="RadGridViewC"> </telerik:RadGridView> <telerik:RadTabItem.Content> </telerik:RadTabItem></telerik:RadTabControl>When I set the RadTabItem B as the selected Tab on first load, this works for GridView B (I can see the highlighted selectedItem) but the other tab don't seem to have selectedItem on their respective GridView when I click on RadTabItem A or C.
Is it not possible to set selectedItem for GridView on the tab that is not selected?
If it is, then how come when I click on Tab B, the selectedItems for GridView B is still null? (I've tried to re-set the selectedItem during RadTabControl_SelectionChanged event as well).
I did a trace and it seems GridView B.HasItems is set to true after RadTabItem C is selected (selection changed) eventhough I've set the ItemsSource for each GridView on first load.
The flow would be RadTabItem A (default 1st load) -> RadTabItem B (no SelectedItems on GridView B) -> RadTabItem C (right now I can see that GridViewB.HasItems is set to true) -> RadTabItem B (I can now see the selectedItem for GridView B)
I may be doing something wrong here but not sure where.