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.

changing filterresult on active range.

Thread ID:

Created:

Updated:

Platform:

Replies:

7604 Oct 2,2003 05:44 AM Oct 3,2003 10:47 AM Windows Forms 1
loading
Tags: GridControl
Markus Kraft
Asked On October 2, 2003 05:44 AM

Hi, i have a range problem on activated filter. its a little bit complicated to explain: 1. the first col in the gdbg is a checkbox column. 2. the active filterargument is "true" (shows only checked rows). 3. when a user select a part of the checkbox column (GridRangeInfo top=5, bottom = 20), on right mouseclick my contextmenue appears and the user set the value to unchecked. the contextmenu writes values in the selected range. 4. when now the first cell in range will unchecked these row is jumping out of the filterresult (because now the value is not "true"). 5. in my codesnippet the range.GetNextCell is not the next cell it is second after. 6. only each second row will be changed. 7. to turn of the layout and suspend the binder was not sucessfully. snippet: bool bTmp = oneSelectedRange.GetFirstCell(out nRow, out nCol); do { if (nRow >= 2) // disable Header and Filterrow { // get Datarow via Currency Manager DataRowView drv = m_CurrencyManager.List[nRow-2]as DataRowView; if (drv != null && drv.Row[strColName].ToString() != p_Value.ToString()) //set only real changes { drv.Row[strColName] = p_Value; } } } while(oneSelectedRange.GetNextCell( ref nRow, ref nCol) == true&& nRow - 1 <= m_CurrencyManager.List.Count); is it possible to get a specific cell of a range (not only getNextCell), or is another way to resolve the problem better? greetings markus

Administrator [Syncfusion]
Replied On October 3, 2003 10:47 AM

> Hi, > i have a range problem on activated filter. > its a little bit complicated to explain: > > 1. the first col in the gdbg is a checkbox column. > 2. the active filterargument is "true" (shows only checked rows). > 3. when a user select a part of the checkbox column (GridRangeInfo top=5, bottom = 20), on right mouseclick my contextmenue appears and the user set the value to unchecked. > the contextmenu writes values in the selected range. > > 4. when now the first cell in range will unchecked these row is jumping out of the filterresult (because now the value is not "true"). > > 5. in my codesnippet the range.GetNextCell is not the next cell it is second after. > > 6. only each second row will be changed. > > 7. to turn of the layout and suspend the binder was not sucessfully. > > snippet: > bool bTmp = oneSelectedRange.GetFirstCell(out nRow, out nCol); > do > { > if (nRow >= 2) // disable Header and Filterrow > { > // get Datarow via Currency Manager > DataRowView drv = m_CurrencyManager.List[nRow-2]as DataRowView; > if (drv != null && drv.Row[strColName].ToString() != p_Value.ToString()) > //set only real changes > { > drv.Row[strColName] = p_Value; > } > } > } > while(oneSelectedRange.GetNextCell( ref nRow, ref nCol) == true&& nRow - 1 <= m_CurrencyManager.List.Count); > > > > is it possible to get a specific cell of a range (not only getNextCell), or is another way to resolve the problem better? > > greetings markus I think one idea would be not to loop through the CurrencyManager top to bottom. If you do that and a row is filter because of the change you change the next row is not what you expected it to be. But if you loop from bottom to top then resetting the checked stated (and falling out of filter view) will only affect rows below. To loop from bottom to top don't use GetNextCell. Instead make two loops for (int row = range.Bottom; row >= range.Top; row--) { for (int col = range.Right; col >= range.Left; col--) { // here goes your loop logic } } 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.

;