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

Self-Referencing Grid, Insert New Child/Parent Row

9 Answers 229 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 27 Sep 2008, 11:22 AM
Hi, When Insert new row in a self-referencing RadGrid, how to tell this is a Child row or a Parent (how to catch the parentID ?)

9 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 29 Sep 2008, 01:58 PM
Hello Ivan,

Please find more about inserting records with RadGrid in the following articles:
http://www.telerik.com/help/aspnet-ajax/grdextractprimarykeyforparentiteminhierarchyonupdateinsert.html
http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/DataEditing/ThreeLevel/DefaultCS.aspx

Check it out and let me know if you need further directions.

Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ivan
Top achievements
Rank 1
answered on 14 Oct 2008, 08:51 PM
Thanks Iana its working, got another question on Self-Referencing:

how to add "Insert" button on the row, when i insert one row.. i cannot insert any child for it, i need "insert" button on every row.
0
Ivan
Top achievements
Rank 1
answered on 14 Oct 2008, 08:51 PM
Thanks Iana its working, got another question on Self-Referencing:

how to add "Insert" button on the row, when i insert one row.. i cannot insert any child for it, i need "insert" button on every row.
0
Sebastian
Telerik team
answered on 15 Oct 2008, 07:23 AM
Hi Ivan,

You may consider adding a GridButtonColumn to your master table with CommandName="InitInsert" and Text="Insert". This column will be cloned for the nested levels in the self-referencing hierarchy and thus you will have the option to trigger init insert command from the button rendered for each row and display the insertion form.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ivan
Top achievements
Rank 1
answered on 15 Oct 2008, 09:33 AM
Thanks Stephen, but isn't there anyway to add the button "Add New Record" on the above of every row till (n-1) in the self referencing, in other words when i select the "MaximumDepth= 3" the "Add New Record' button should appear above the rows till depth 2, so i can add child rows till i reach the max depth. thanks
0
Sebastian
Telerik team
answered on 15 Oct 2008, 09:43 AM
Hi Ivan,

If you set CommandItemDisplay to a value different than None (default), the [Add new record] button will be displayed for each level of the self-referencing hierarchy to insert new items (taking into account the maximum depth you set to avoid adding more nested levels).

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ivan
Top achievements
Rank 1
answered on 15 Oct 2008, 12:05 PM
I have the CommandItemDisplay set on Top but in only shows the "Add New Record" on the rows with child nodes only, but when i add a new row for example a row with parentID = 0 it will not show "Add New Record" above it.
0
Ivan
Top achievements
Rank 1
answered on 15 Oct 2008, 12:05 PM
I have the CommandItemDisplay set on Top but in only shows the "Add New Record" on the rows with child nodes only, but when i add a new row for example a row with parentID = 0 it will not show "Add New Record" above it.
0
Ivan
Top achievements
Rank 1
answered on 15 Oct 2008, 01:05 PM

its working now, am sorry didnt notice that there was 

 

public

void Page_PreRenderComplete(object sender, EventArgs e)

 

{

 HideExpandColumnRecursive(RadGrid1.MasterTableView);
}

 

Tags
Grid
Asked by
Ivan
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Ivan
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or