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

radGrid Auto Selects the first row when populated.

5 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Christopher Chenoweth
Top achievements
Rank 1
Christopher Chenoweth asked on 19 Apr 2010, 03:00 AM
Hello,

I would like to know how to prevent radGrid from auto selecting the first row when it loads data in silverlight 4 rtm.

Thank you,
Christopher

5 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 19 Apr 2010, 08:37 AM
Hello Christopher,

Actually this is the grid CurrentItem. I've attached small example to illustrate you how to achieve your goal.

Best wishes,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Christopher Chenoweth
Top achievements
Rank 1
answered on 20 Apr 2010, 12:14 AM
Thank you Vlad!

Essentially it is just:
        private void rgSearch_DataLoaded(object sender, EventArgs e)  
        {  
            Dispatcher.BeginInvoke(() => 
                {  
                    rgSearch.CurrentItem = null;  
                });  
        } 

Works great.  Thank you.
0
Fabrice Marguerie
Top achievements
Rank 1
answered on 08 Jun 2010, 10:40 PM
This didn't work in my case. The following worked instead:

void gridView_RowLoaded(object sender, RowLoadedEventArgs e)
{
  e.Row.IsSelected = false;  
}
0
Vajirani Kankanange
Top achievements
Rank 1
answered on 17 Jun 2010, 01:09 AM
None of the above worked for me and I had a selectionchanged event and it was always setting the first item as selected.

I'm actually bind the datagrid from XAML the SelectionChanged is not automatically being called.

 

0
Vlad
Telerik team
answered on 17 Jun 2010, 06:27 AM
Hello,

You can set IsSynchronizedWithCurrentItem to false. 

Best wishes,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Christopher Chenoweth
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Christopher Chenoweth
Top achievements
Rank 1
Fabrice Marguerie
Top achievements
Rank 1
Vajirani Kankanange
Top achievements
Rank 1
Share this question
or