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

[Solved] Expand Item

2 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dany V
Top achievements
Rank 1
Dany V asked on 06 Jul 2009, 11:49 PM
Hi! Right now I'm working with a Hierarchical Grid, so the thing is...I have two levels in the Grid, and in both of them I can edit the Items and the data of the child records have influence on one field of the parent, I mean, if one or more child records have values in certain field, the status of the parent will be "O", and if there are any record have value, the status will be "A", and finally if all the child have values, then the status will be "C".....so the problem is that when I edit the child records, the status of the parent dont change after I refresh the window or call RadGrid1.DataSource = Nothing....but when I do that the parent Item collapse....and I want to keep it expanded....

And another thing is that I open a window when I double clicked any row...but I want that this function only works on the parent items and not on the child records....because it throw me an error when I clicked the child.

Thanks in advance!!! =)
Daniel

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jul 2009, 04:24 AM
Hi Daniel,

Go through the following code library submission which explains how to retain the expanded/selected state in a hierarchical Grid on rebind.
Retain expanded/selected state in hierarchy on rebind

The second issue can be solved by setting the Name property for the Master table. You may check in the client side whether the double clicked row belongs to the master or child table.

ASPX:
 
<MasterTableView   Name="MasterTable"  > 

JS:
 
 
<script type="text/javascript">  
   function RowDblClick(sender, eventArgs) 
     {                          
       if(eventArgs.get_tableView().get_name() == "MasterTable"
           {                    
                 
            // execute the code 
           }         
      } 
 
</script> 

Raising client event for rows once in hierarchical grid

Thanks
Shinu
0
Dany V
Top achievements
Rank 1
answered on 07 Jul 2009, 05:19 PM
Thanks Shinu!!...that solve my problems
Tags
Grid
Asked by
Dany V
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dany V
Top achievements
Rank 1
Share this question
or