I have a parent/child relation in ultrawingrid. I want to be able to select multiple child rows but within the same parent. if the user selects from a different parent, i do not want to allow that selection. Is there any way we can do this?
Hi,
There's no property setting of this, but you can do it pretty easily in code.What you do is handle the BeforeSelectChange and loop through the new selected rows. If the collection contains rows from different rows collections, then you cancel the selection.
Something like this:
void ultraGrid1_BeforeSelectChange(object sender, BeforeSelectChangeEventArgs e) { if (e.NewSelections.Rows.Count > 1) { RowsCollection rows = e.NewSelections.Rows[0].ParentCollection; for (int i = 1; i < e.NewSelections.Rows.Count; i++) { if (e.NewSelections.Rows[i].ParentCollection != rows) { e.Cancel = true; return; } } } }
Thanks a lot Mike... Its working prefectly fine
Many Thanks
Amjath