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

How to set GridView.SelectedItem?

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mehmet Akturk
Top achievements
Rank 1
Mehmet Akturk asked on 09 Sep 2009, 10:58 AM
How to set GridView.SelectedItem in Example below?

Gridview.ItemSource is setted datatable that includes Vendors(Vendor class)

public void setSelectedItem(Vendor handledVendor)
{
    GridView.SelectedItem = (object)handledVendor;             //What must code be?
}

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 09 Sep 2009, 03:33 PM
Hello Mehmet Akturk,

If your grid is bound to a list of vendor you just have to assign the handled vendor to te SelectedItem property:

public void setSelectedItem(Vendor handledVendor)  
{  
    GridView.SelectedItem = handledVendor;               
}   
 


All the best,
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
Mehmet Akturk
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or