We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Delete records in selected range from the datasource

Thread ID:





23104 Jan 5,2005 12:18 AM Jan 6,2005 09:22 AM Windows Forms 4
Tags: Grouping
Asked On January 5, 2005 12:18 AM

i am able to retrieve a list of selected records in a GGC via: Me.ggc.TableModel.SelectedRanges i used: Me.ggc.TableModel.Rows.RemoveRange() but apparently it only unselect the selected rows. how do i delete the records from the ggc instead of unselecting?

Administrator [Syncfusion]
Replied On January 5, 2005 03:00 AM

You can try using this.gridGroupingControl1.Table.DeleteRecord Or, you can work directly with your datasource and use methods on it to delete its records. With the 3010 code base, if you use the new record selection support, this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; then this button handler will delete the selected records.
private void button2_Click(object sender, System.EventArgs e)
	foreach(SelectedRecord r in this.gridGroupingControl1.Table.SelectedRecords)

Replied On January 5, 2005 11:01 PM

i am currently developing in 2109. i tried to use this.gridGroupingControl1.Table.DeleteRecord. however, how do i retrieve a list of selected records from the ggc? thanks.

Administrator [Syncfusion]
Replied On January 6, 2005 03:23 AM

You can try code like this.
private void button2_Click(object sender, System.EventArgs e)
	ArrayList recs = new ArrayList();
	foreach(GridRangeInfo r in this.gridGroupingControl1.TableModel.Selections.GetSelectedRows(true, false))
		for(int row = r.Top; row <= r.Bottom; ++row)
			GridTableCellStyleInfo style = this.gridGroupingControl1.TableModel[row, 1];
			GridRecordRow rr = style.TableCellIdentity.DisplayElement as GridRecordRow;
			if(rr.ParentRecord != null)
				recs.Add(rr.ParentRecord );

	foreach(Record rec in recs)

Replied On January 6, 2005 09:22 AM

cool! the codes work great! however, it seem pretty tough to find out what methods/properties to use in order to achieve what i want...


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.