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

[Solved] how to select first row in the grid after PageIndexChanged event

3 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prakash
Top achievements
Rank 1
Prakash asked on 18 Aug 2009, 08:58 AM
hi,

i want to select the first row in the grid after pageindexchange event.

i tried the below code but it is not working 

rgStockItem.MasterTableView.Items[0].Selected =

true;

any help will be greatly appreciated.

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Aug 2009, 09:22 AM
Hi Prakash,

Try the above given line of code in the PreRender event of the Grid to always select the first row in Grid.

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


Thanks
Shinu
0
Prakash
Top achievements
Rank 1
answered on 18 Aug 2009, 11:56 AM
Thanks Shinu :) Its working now....:)
0
Shinu
Top achievements
Rank 2
answered on 19 Aug 2009, 03:45 AM
Hi Prakash,

You can also have a look at the following help article which explains how to make a grid row selected at all times.
Making a grid row selected at all times (similar to WinForms grids)

Regards
Shinu
Tags
Grid
Asked by
Prakash
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Prakash
Top achievements
Rank 1
Share this question
or