delete record at child view on grid view

2 posts, 1 answers
  1. vinson
    vinson avatar
    3 posts
    Member since:
    Feb 2017

    Posted 27 Feb 2017 Link to this post

    Hi I am a new user of telerik,

    I am currentlying using the grid view extension make by Richard

    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

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4086 posts

    Posted 28 Feb 2017 Link to this post

    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:
    I hope this information helps. Should you have further questions I would be glad to help.

    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.
Back to Top