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

Paging: Select next page element before PreRender

2 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Natali
Top achievements
Rank 1
Natali asked on 09 Dec 2008, 05:47 PM
Hello,

I have a RadGrid with paging. After clicking on "Next" button, I want to select the 1st item on next page and render some information about this 1st selected element in Page_Load. The problem: only RadGrid1_PreRender event can tell me about new 1st element on next page, earlier - e.g. Page_Load event  doesn't know anynothing about next source ( grid.Items are still old in Page_Load). Is it possible to know about new items on next page earlier  RadGrid1_PreRender event?

Best regards,
Natali

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 10 Dec 2008, 04:07 AM
Hi Natali,

Try accessing the Grid row in the DataBound event of the RadGrid which will fire prior to the PreRender event

CS:
 protected void RadGrid1_DataBound(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.ItemIndex == 0) 
            { 
                item.Selected = true
                string strtxt = item["columnUniqueName"].Text; 
 
            } 
        } 
    } 

Event sequence

Shinu
0
Natali
Top achievements
Rank 1
answered on 10 Dec 2008, 08:20 AM
Perfect! Thank you!

Best regards,
Natali

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