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

[Solved] How to set the selected row?

2 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vinix
Top achievements
Rank 1
Vinix asked on 28 Apr 2008, 08:11 AM
I bind the RadGrid to a SqlDataSource.
How to I set the first row of RadGrid as selected?
Many thanks for your replying.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 28 Apr 2008, 09:58 AM
Hi,

Try the code snippet below in the PreRender event  to select the first row in the grid:

CS:
  protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        if (!IsPostBack) 
            RadGrid1.MasterTableView.Items[0].Selected = true
    }  


Thanks,
Princy
0
Vinix
Top achievements
Rank 1
answered on 28 Apr 2008, 12:18 PM
It works, thank you very much.
Tags
Grid
Asked by
Vinix
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vinix
Top achievements
Rank 1
Share this question
or