RadGrid hierarchy is a very nice feature, but very little is explained in all the documents. An example is provided with Sqldatasource by setting the MasterField and DetailField and maintain a link by a select parameter like this:
<SelectParameters>
<asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
</SelectParameters>
the magic is that this SessionField does not need to be updated by any code after row change, server side or client side. Maybe there's embeded special treatment for Sqldatasource ? I used an ObjectDatasouce as the datasource and how could I get the current MasterField value during the OnSelecting event of ObjectDatasource ? One solution could be getting the current row in the masterview during OnHierarchyExpanding event and save it for selecting parameter of the childview. This way only one level of the master-detail hierarchy can be maintained (OnHierarchyExpanding event only attach to the MasterView). When tried to implement this fix I found out that OnHierarchyExpanding client event never fired off, is this a problem or something extra must be done to enable it besides setting the client event handler like this:
<ClientEvents OnHierarchyCollapsing="OnHierarchyExpanding" />
I would be much appreciated if anyone could help me out here!!!
<SelectParameters>
<asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
</SelectParameters>
the magic is that this SessionField does not need to be updated by any code after row change, server side or client side. Maybe there's embeded special treatment for Sqldatasource ? I used an ObjectDatasouce as the datasource and how could I get the current MasterField value during the OnSelecting event of ObjectDatasource ? One solution could be getting the current row in the masterview during OnHierarchyExpanding event and save it for selecting parameter of the childview. This way only one level of the master-detail hierarchy can be maintained (OnHierarchyExpanding event only attach to the MasterView). When tried to implement this fix I found out that OnHierarchyExpanding client event never fired off, is this a problem or something extra must be done to enable it besides setting the client event handler like this:
<ClientEvents OnHierarchyCollapsing="OnHierarchyExpanding" />
I would be much appreciated if anyone could help me out here!!!