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

[Solved] Select a row in a radgrid based on a cell value

1 Answer 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 18 Jan 2010, 01:13 PM
Is it possible to select a row in a radgrid based on a cell value e.g. column ID, and we want to select row with cell of ID = 12?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jan 2010, 01:52 PM
Hi Jaromin,

Here is the code snippet in order to select a row based on cell value.

CS:
 
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            if(item["CustomerID"].Text == "ANTON"
            { 
                item.Selected = true
            } 
        } 
    } 

-Shinu.
Tags
Grid
Asked by
wnl
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or