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. Image for the cookie policy date
close icon

changing filterresult on active range.

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

1 Reply

AD Administrator Syncfusion Team October 3, 2003 02:47 PM UTC

> 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

Loader.
Live Chat Icon For mobile
Up arrow icon