13 Answers, 1 is accepted
I am not sure of your requirement. If you are trying to access the DetailTable, then the following help articles will help you in this.
Traversing detail tables/items in Telerik RadGrid
Distinguish grid rows in hierarchy on ItemCreated/ItemDataBound
Could you elaborate your scenario if this doesn't help you?
I have the same problem with Tan. The radgrid has 3 hierarchies, and each hierarchy has a custom command item for Add,Edit and Delete. My problem is, how to handle the event of linkbutton inside the detail table (GridTableView Name Detail2 and 3)?
Below is my aspx
The RadGrid.ItemCommand event will be fired when a custom command bubbles from the CommandItem, which lets you define custom functionality that can be executed in the ItemCommand handler. And you can check with the name of OwnerTableView to identify the operaion for MasterTable/DetailTables.
Thanks for your reply. But I have another problem, how to show/hide some link buttons after clicking the Add or Edit? Even though i set the property of link button to true, it will not appear in the command item.
Kindly check my code below.
You can try this in ItemDataBound event. In ItemCommand event you can identify which operation is performing and store the opeartion name in a hiddenField .Then in ItemDataBound event based on this HiddenField value, hide the corresponding controls. Check out the sample code.
I really appreciate your quick response. The sample code you provided is working. But, I have another problems
- how to find the edit itemtemplate control inside the detail table? I want to show the tbVisitSortOrder textbox when clicking the edit link button.
- Upon clicking the cancel button from detail table, the detail grid and parent grid will collapsed. how to save the state of parent table as expanded?
- how to select the row of newly added data or currently edited data in detail table?
- how to rebind the Detail3 detail table after adding new data? in master_itemcommand event, i added the code to insert the new data. please check my code below.
Thanks a lot Princy!
Please help me with my last problem. I am not getting any answer from your team anymore.
I would really appreciate for any response.
Straight to your questions:
- Please take a look at the Referencing controls in grid row/edit form help topic to see how to find the desired control.
- You can use the approach from the Retain expanded/selected state in hierarchy on rebind code library.
- Please examine the Select Last Inserted Row in the RadGrid with both Paging and Sorting enabled code library to see how this functionality can be achieved.
- Please check the Inserting values in-place and EditForms help topic to learn the proper ways to insert grid rows with InPlace and EditForms edit mode.
I hope this helps.
the Telerik team
I already tried the code in Retain expanded/selected state in hierarchy on rebind. But I have a problem, every time I click on edit command item in detail 3 the other command item for detail 2 and master table also changes.
Please see the attached screenshots Before and After clicking the edit command item in detail 3.
Below is my C# code for customizing the visibility of command items.
Please help me with my problem that i posted last 2 days ago. I really have no idea, why is the command items for master table and detail table 2 changes, every time i click on edit in detail table 3.
Below is the code that I have added to retain expanded/selected in hierarchy.
I looked through your code and I cannot see an obvious reason for the described issue.
Please send us a small working project, demonstrating your full setup and showing the unwanted behavior.
We will debug it locally and get back to you.
Thank you in advance for the cooperation.
the Telerik team
Please disregard my problem. I already figured it out why are the command items in master table changes, every time i click on edit in any detail table.
I forgot to mention that I have set the visibility of command items in master table in aspx.
Thanks for replying.