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

[Solved] Selecting a Row when ItemDataBound

1 Answer 258 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 24 Feb 2008, 03:59 AM
I am trying to select a row from a RadGrid when it binds and I cannot get it to work....

It does not like e.item.dataitem("") nor does it do anything when I use the e.item.selected = true.

Protected Sub vendorGridView_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles vendorGridView.ItemDataBound 
 
        If Session("VendorClientID") = e.Item.DataItem("ClientID") Then 
 
        e.Item.Selected = True 
 
        End If 
 
 
    End Sub 


Any help would be appreciated.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 25 Feb 2008, 01:22 PM
Hello Matt,

You need to cast DataItem to your object type - please refer to attached example.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or