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

Hierarchal Grid - Expended Row

1 Answer 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ELBU
Top achievements
Rank 1
ELBU asked on 01 Mar 2009, 03:54 PM
Hi all,
I'd very appreciate your help in the following question.

I have hierarchal grid with 2 levels.
after user expanding some row , I want in code behind to know what is the value of some column  
for example : 1 level - students , 2 level - their grades
id   name    age
----   ------    ------
111      Anna    25
         subject        grade
          ---------       --------
          math             100
          english           99

222      Inna      30

what I need is in code behind if user expanded "Anna" is to get "111" value.

P.S. If there is some grid event for catching the expansion on server , write it also for me please .

THANK A LOT

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Mar 2009, 04:54 AM
Hi,

You can try out the following code in the PreRender event of the grid to access the cell value of a row when it is expanded:
cs:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
       foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items) 
        { 
           if (dataItem.Expanded) 
            {                
                { 
                   string strtxt = dataItem["id"].Text; 
                } 
            } 
        }  
     } 

Thanks
Princy.
Tags
Grid
Asked by
ELBU
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or