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

GridView doesn't show any content

3 Answers 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
uku
Top achievements
Rank 1
uku asked on 16 Jul 2009, 11:10 PM
Hello,

I started testing the RadControls for Silverlight 3 beta especially because it has more functionality than the DataGrid delivered with the Silverlight Toolkit and I would like to switch to the Telerik components, but need to be sure, that everything works fine.

I come across a problem concerning a different behaviour between the Telerik GridView and the MS DataGrid and I hope I'll find some assistance here. The problem is that by assigning the same collection to the ItemsSource to both grids, just the MS DataGrid shows the content. The Telerik grid is increased and the scrollbar is shown, so it seems the grid processes the collection somehow but it remains empty. Not a single row is shown. This problem occurs just if the user control with the grids is loaded by another user control. May be I should give you an example to make it more clear.

Beside App.xaml I've two controls MainPage.xaml and TestPage.xaml

MainPage.xaml is just a container for hosting other controls. Within TestPage.xaml I've added both grid versions.

// following code is part of MainPage.xaml to load the TestPage.xaml

....


private
 TestPage _TestPage;

 

 

public MainPage()

 

{

InitializeComponent();

}

 

private void StartTestPage_Click(object sender, RoutedEventArgs e)

 

{

    _TestPage =

new TestPage();

 

    MainArea.Children.Clear();

    MainArea.Children.Add(_TestPage);

}
....

// the following code is taken from TestPage.xaml
....
private ObservableCollection<TestType> _TestCollection;

 

 


public
TestPage()

 

{

    InitializeComponent();

    Loaded +=

new RoutedEventHandler(TestPage_Loaded);

 

}

 

void TestPage_Loaded(object sender, RoutedEventArgs e)

 

{

    LoadTestCollection();

    ShowTestCollection();

}

 

private void ShowTestCollection()

 

{

    TestGridMS.ItemsSource = _TestCollection;  //MS grid shows the content

    TestGridTelerik.ItemsSource = _TestCollection; //Telerik grid doesn't show the content

}

 

private void LoadTestCollection()

 

{

    _TestCollection = (

TestCollection)this.Resources["TestCollection"];

 

}

 

....

If I'm assigning the TestPage directly to the RootVisual within App.xaml, than everything works fine and the content is shown in both grids, but if I load the TestPage from the MainPage, than just the MS grid shows the content. I hope someone can tell me what's going wrong, or what I have done wrong.

Thanks in advance for your help

3 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 17 Jul 2009, 06:23 AM
Hi uku,

I've created simple project (from your code) that show both grids and everything is working fine.
Please find the attached project and let us know if this is not your case.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
uku
Top achievements
Rank 1
answered on 17 Jul 2009, 12:06 PM
Hi Hristo,

first of all I want to thank you a lot for your extremly fast response. I've read some comments about the excellent Telerik support and my first contact with Telerik confirms these positive reactions 100%

The sample project you've send me works without any problem and helps me to figure out the strange behaviour of my own project. The problem was a wrong ScrollViewer definition which embraces the grid definitions. The MS grid simply seems to ignore that and the Telerik grid apparently tries to handle it, which causes the empty grid. After I've removed the ScrollViewer the content is shown without any problems.

I will continue testing with the grid especially with a relative huge amount of data (100.000 records) which is important for my app but if I can handle this amount of data, then I will definitely switch to the Telerik grid.

Thanks again for your help and have a nice weekend

Bye

Uwe
0
Vlad
Telerik team
answered on 17 Jul 2009, 12:25 PM
Hi Uwe,

You can check our 1mil. records demo:
http://demos.telerik.com/silverlight/#GridView/Performance/ClientSide

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
uku
Top achievements
Rank 1
Answers by
Hristo
Telerik team
uku
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or