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.

Removing Selected Rows

Thread ID:

Created:

Updated:

Platform:

Replies:

7371 Sep 23,2003 07:24 AM Sep 23,2003 04:37 PM Windows Forms 2
loading
Tags: GridControl
Luc
Asked On September 23, 2003 07:24 AM

I have a remove button on a form that lets the user remove multiple selections of rows. What would be the best way to do this. I have tried GridRangeInfoList r = gridControl1.Selections.GetSelectedRows(true, true); this gets me the range but I can't seem to get the index (int) of the rows. Please tell me what is the best way of removing multiple selections of rows.

Luc
Replied On September 23, 2003 12:28 PM

> I have a remove button on a form that lets the user remove multiple selections of rows. What would be the best way to do this. I have tried GridRangeInfoList r = gridControl1.Selections.GetSelectedRows(true, true); this gets me the range but I can't seem to get the index (int) of the rows. Please tell me what is the best way of removing multiple selections of rows. > I answered my own question. Here is what I did for those that are interested. foreach(GridRangeInfo r in gridControl1.Selections.GetSelectedRows(true,true)) { gridControl1.Rows.RemoveRange(r.Top, r.Bottom); } the r.top and r.bottom did not do what I though they did.

Administrator [Syncfusion]
Replied On September 23, 2003 04:37 PM

Try to reverse looping throw the ranges, e.g. GridRangeInfoList ranges = gridControl1.Selections.GetSelectedRows(true,true); for (int n = ranges.Count-1; n>= 0; n--) gridControl1.Rows.RemoveRange(ranges[n].Top, ranges[n].Bottom); Stefan

CONFIRMATION

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.

;