Hi,
I am using 2 level heirarchy in my radgrid. The detail table is displayed with the click of an expansion sign (I guess it depends on the skin) we are using. Is there any way I can add a text to this column such as 'Select' so that it is more visible to the user.
Also, is it possible that the detail table gets displayed by selecting anywhere on the row?
I really appreciate any help!
regards,
Anu
I am using 2 level heirarchy in my radgrid. The detail table is displayed with the click of an expansion sign (I guess it depends on the skin) we are using. Is there any way I can add a text to this column such as 'Select' so that it is more visible to the user.
Also, is it possible that the detail table gets displayed by selecting anywhere on the row?
I really appreciate any help!
regards,
Anu
4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 03 Apr 2009, 12:26 PM
Hi Anu,
One suggestion will be to hide the Expand/Collapse column and use a GridButtonColumn so that you can set the Text and CommandName of the GridButtonColumn . You can try the following code snippet to achieve the desired scenario.
CS:
CS:
Thanks
Shinu
One suggestion will be to hide the Expand/Collapse column and use a GridButtonColumn so that you can set the Text and CommandName of the GridButtonColumn . You can try the following code snippet to achieve the desired scenario.
CS:
| <telerik:GridButtonColumn Text="Select" CommandName="ExpandCollapseItem" ></telerik:GridButtonColumn> |
CS:
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "ExpandCollapseItem") |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| item.Expanded = !item.Expanded; |
| } |
| } |
Thanks
Shinu
0
Anu
Top achievements
Rank 1
answered on 03 Apr 2009, 12:30 PM
Hi Shinu,
Thanks for your answer. How do I hide the default Expand/Collapse Column?
many thanks,
Anu
Thanks for your answer. How do I hide the default Expand/Collapse Column?
many thanks,
Anu
0
Princy
Top achievements
Rank 2
answered on 03 Apr 2009, 04:51 PM
Hello Anu,
Try the following code snippet in the PreRender event for hiding the expand/collapse column in hierarchical Grid.
CS:
Refer the following link also.
Preventing groups expansion by hiding the expand/collapse images
Thanks,
Princy.
Try the following code snippet in the PreRender event for hiding the expand/collapse column in hierarchical Grid.
CS:
| RadGrid1.MasterTableView.GetColumn("ExpandColumn").Display = False |
Refer the following link also.
Preventing groups expansion by hiding the expand/collapse images
Thanks,
Princy.
0
Anu
Top achievements
Rank 1
answered on 06 Apr 2009, 11:34 AM
Hi Shinu,
Thanksagain for your reply. I tried it and it is working! great!
I have another question, if you don't mind...
In the event handler, RadGrid1_ItemCommand(...), I tried to change the display text depending on whether the row is expanded or not. But, unfortunately, once I change the text, it does not work as a link any more. I mean instead of a buttoncolumn with an underlined text (as a link), the cell just displays the text only.... Can you think of any reason for this?
many thanks,
Anu
Thanksagain for your reply. I tried it and it is working! great!
I have another question, if you don't mind...
In the event handler, RadGrid1_ItemCommand(...), I tried to change the display text depending on whether the row is expanded or not. But, unfortunately, once I change the text, it does not work as a link any more. I mean instead of a buttoncolumn with an underlined text (as a link), the cell just displays the text only.... Can you think of any reason for this?
many thanks,
Anu