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

Integrating next and previous buttons

4 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 21 May 2012, 02:07 PM
Hi there,
      Im working on a collection of data in a grid. I want to set the first row of the grid selected on page-load. If anyone got any ideas please be kind enough to share.

Thanks
Savyo

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 May 2012, 02:26 PM
Hi Savyo,

Please try the following code snippet to select the first row in page load.

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

Thanks,
Shinu.
0
Savyo
Top achievements
Rank 1
answered on 22 May 2012, 08:24 AM
That works!!
Thanks for the code..
0
Savyo
Top achievements
Rank 1
answered on 22 May 2012, 08:26 AM
Can I get the index number of a row in the on-click of the row. Is there any possible solution??
0
Shinu
Top achievements
Rank 2
answered on 22 May 2012, 08:45 AM
Hi,

Try the following Javascript to get the row index when you click a row.

JavaScript:
<script type="text/javascript">
    function OnRowClick(sender, args)
    {
        var rowindex = args._itemIndexHierarchical;
        alert(rowindex);
    }
</script>

Thanks,
Shinu.


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