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

IsSelected Property

1 Answer 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sum sum
Top achievements
Rank 1
sum sum asked on 03 Nov 2009, 07:09 PM
Hi Guys,

I was using the Telerik dll version 2009.2.701. something. At that time, if I switch the positions of two records, I would not lose the focus/selection on the original record. But after I upgraded to 2009.2.813. something, I am losing the focus after I switch the records. What I am trying to do now is to manually set the grid.Records[1].IsSelected = true. But it is not working. Any suggestions?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 04 Nov 2009, 09:25 AM
Hi sum sum,

With Q2 2009 we started to move away from using records and introduced properties like SelectedItems, CurrentItem, SelectedItem to replace the old ones Selectedrecords, CurrentRecord, SelectedRecord. 

You should modify your original code to use items instead of records. For example:

// if you are using single selection
this.grid.SelectedItem = this.grid.Items[1];
  
// or if you are using multiple selection
this.grid.SelectedItems.Add(this.grid.Items[1]);

Hope this helps.


Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
sum sum
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or