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

RadGrid Paging Problem

3 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff Tang
Top achievements
Rank 1
Jeff Tang asked on 05 Aug 2008, 03:56 AM
I am using Q1 2008. I am trying to get the first row of the current grid page in PageLoad function of server side. The problem is that when I switch the page of the grid to 2, it still get the first row of the first page instead of second page. So I want know how I can do it. Thanks.

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Aug 2008, 06:02 AM
Hi Jeff,

Try accessing the first row of a Grid in the PreRender event as shown below.

CS:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        GridDataItem DataItem = RadGrid1.MasterTableView.GetItems(GridItemType.Item)[0] as GridDataItem; 
    } 



Thanks
Shinu.
0
Jeff Tang
Top achievements
Rank 1
answered on 05 Aug 2008, 06:34 AM
I can fixed the problem but another problem comes out. I use the following code to get the row 2, but it get row3. Actually what I am trying to do is to add a tooltip on a specific column of the grid, and the text of the tooptip require to retrieve from database based on the value of the cell in different row.

GridDataItem DataItem = RadGrid1.MasterTableView.GetItems(GridItemType.Item)[1] as GridDataItem; 



0
Accepted
Sebastian
Telerik team
answered on 05 Aug 2008, 06:39 AM
Hi Jeff,

Below are two possible approaches to reference the second row in your grid:

GridDataItem DataItem = RadGrid1.MasterTableView.Items[1] as GridDataItem; 
GridDataItem DataItem = RadGrid1
.MasterTableView.GetItems(GridItemType.AlternatingItem)[0] as GridDataItem; 

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jeff Tang
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jeff Tang
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or