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

Rows not appearing automatically

1 Answer 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 27 Feb 2012, 05:33 PM
If I simply add a gridview and leave all the default properties, then try and populate it with this simple code:

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List<string> strings = new List<string>();
            radGridView1.ItemsSource = strings;
 
            strings.Add("a");
            strings.Add("b");
            strings.Add("c");
 
            radGridView1.Items.Refresh();
        }

The rows do not appear until I click a column header to re-order that column. As Items.Refresh() does not work what can I call to make the rows appear?

I know using an ObservableCollection rather than list<string> will work, but I can't do that in this situation.

thanks



1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 27 Feb 2012, 05:38 PM
Hello Martin,

RadGridView.Rebind() should do the trick. 

Kind regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Martin
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or