I have a two-level hierarchy with rows in the master grid and then another GridTableViewin the DetailTables. It all displays fine and lets me expand/collapse the detail as long as I do not enable row selection with postback. I need to handle the event for row selection changed on the server side, but when I set my ClientSettings as follows:
<ClientSettings EnablePostBackOnRowClick="True" >
<Selecting AllowRowSelect="True" />
</ClientSettings>
then while I do now get my event handler called on row selection if I click anywhere on the row EXCEPT the expand/collapse arrow, I can no longer get the detail table to expand at all. It seems very odd because basically clicking on the expand/collapse arrow now does nothing - neither postback a row selection changed event nor expand/collapse the detail table, yet clicking anywhere else on the row acts properly (event on server side).
Ed
5 Answers, 1 is accepted
0
Ed
Top achievements
Rank 1
answered on 17 Apr 2008, 08:08 PM
Found it.
Although the grid already had the correct DataSourceID set, I was setting it again (to the same value) when I was setting up my server side event handlers in my code-behind (essentially in OnLoad of the parent control.) For some reason, even though I wasn't actually changing the value that it was set to, doing so would cause the weird behavior of the Detail table expansion not working. It turned out the other settings were neither the cause nor relevant, but I was fooled because i had made a few changes at once as well as having some other issues related to handling of row selection now that I have detail tables (first time I've done so.)
I haven't looked at the radgrid source for it yet, but it does still seem a little odd that setting the value, without changing the value, of DataSourceID should have any effect whatsoever, but at least I am past that issue.
-Ed
Although the grid already had the correct DataSourceID set, I was setting it again (to the same value) when I was setting up my server side event handlers in my code-behind (essentially in OnLoad of the parent control.) For some reason, even though I wasn't actually changing the value that it was set to, doing so would cause the weird behavior of the Detail table expansion not working. It turned out the other settings were neither the cause nor relevant, but I was fooled because i had made a few changes at once as well as having some other issues related to handling of row selection now that I have detail tables (first time I've done so.)
I haven't looked at the radgrid source for it yet, but it does still seem a little odd that setting the value, without changing the value, of DataSourceID should have any effect whatsoever, but at least I am past that issue.
-Ed
0
Rycho
Top achievements
Rank 1
answered on 22 Apr 2008, 09:13 PM
Hi,
I found the same bug on the latest version of classic RadGrid.
The point is EnablePostBackOnRowClick="True" which causes such behaviour.
Rycho
I found the same bug on the latest version of classic RadGrid.
The point is EnablePostBackOnRowClick="True" which causes such behaviour.
Rycho
0
Hello,
Enabling the row selection along with the postback on row click functionality does not break the detail tables expanding/collapsing in general. However, setting the DataSourceID may cause Grid rebind, hence you may not see the detail table expanded/collapsed.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Enabling the row selection along with the postback on row click functionality does not break the detail tables expanding/collapsing in general. However, setting the DataSourceID may cause Grid rebind, hence you may not see the detail table expanded/collapsed.
Regards,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Rycho
Top achievements
Rank 1
answered on 23 Apr 2008, 06:48 PM
Hi,
So is there any solution for this problem? Any can agree that databinding thru DatasourceID is one of the most popular scenarios. Hence DetailTables functionality would become useless in that case. Is there any built-in property to maintain expand/collapse state?
Rycho
So is there any solution for this problem? Any can agree that databinding thru DatasourceID is one of the most popular scenarios. Hence DetailTables functionality would become useless in that case. Is there any built-in property to maintain expand/collapse state?
Rycho
0
Hello Rycho,
You can use the DetailTableDataBind along with the NeedDataSource events to update the RadGrid date. This should avoid any problems with unexpected Grid rebind causing actions like expand/collapse of detail tables to fail.
If you missed that, you can take a look at this demo:
http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Programming/DetailTableDataBind/DefaultCS.aspx
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can use the DetailTableDataBind along with the NeedDataSource events to update the RadGrid date. This should avoid any problems with unexpected Grid rebind causing actions like expand/collapse of detail tables to fail.
If you missed that, you can take a look at this demo:
http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Programming/DetailTableDataBind/DefaultCS.aspx
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center