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

delete record at child view on grid view

1 Answer 238 Views
GridView
This is a migrated thread and some comments may be shown as answers.
vinson
Top achievements
Rank 1
vinson asked on 27 Feb 2017, 06:17 AM

Hi I am a new user of telerik,

I am currentlying using the grid view extension make by Richard http://www.telerik.com/forums/details-view-under-row-in-gridview

I have a radbutton which will delete a row of data after pressed. I have no issue with deleting a row of data in the master view. I just cannot get my head around with deleting a row of data in the child view. Secondly, I want a check box to appear next to each row both in master and child view. After each check box is checked and the delete button is pressed I would like the checked row to be delete. My data is loaded directly from a local Microsoft sql server

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Feb 2017, 11:20 AM
Hello Vinson,

Thank you for writing.  

You can access the ChildRows for each data row in RadGridView by the GridViewRowInfo.ChildRows property. Thus, you can manipulate the child rows. As to the check boxes, note that you can use a GridViewCheckBoxColumn and check the cell value before deleting a row. Here is a sample code snippet demonstrating how to access the checkbox value (column "AllowDelete") for the 3rd child row in the first master row:
bool childRowValue = (bool)this.radGridView1.Rows[0].ChildRows[3].Cells["AllowDelete"].Value;

The following help article demonstrates how to iterate the hierarchical rows: http://docs.telerik.com/devtools/winforms/gridview/rows/iterating-rows
 
I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
vinson
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or