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

Gridcontrol - RowEvents

Hi, Is there any event which will be fired once we move from one row to next row or some other row in GRIDCONTROL not in BoundGrid Control.? There are row related events but those are for Range of Rows only. Thanks & Regards RAvi

5 Replies

AD Administrator Syncfusion Team May 15, 2006 12:32 PM UTC

Hi Ravi, Please refer to the below forum thread. http://www.syncfusion.com/Support/forums/message.aspx?MessageID=43807 Let us know if you need any further assistance. Regards, Calvin.


RA Ravichandran May 15, 2006 01:30 PM UTC

Hi Calvin, Fine. But I am getting an exception in paint event if i move from one row to other. But not getting this exception frequently. pls have a look of my code private void EditableGrid_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e) { GridCurrentCell currentCell =this.CurrentCell; if(currentCell.RowIndex != e.RowIndex) { if(m_document.IsDirty) { if ( RowChanged != null ) { m_document.IsDirty = false; RowChanged(currentCell.RowIndex-1); } } } } and also written some code in private void EditableGrid_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e) { GridCurrentCell currentCell =this.CurrentCell; //currentCell.BeginEdit(); if (e.RowIndex > 0 ) { int row = e.RowIndex-1; if (m_document[row, e.ColIndex] != e.Style.CellValue) { m_document[row, e.ColIndex] = e.Style.CellValue; m_document.IsDirty = true; } e.Handled = true; } //currentCell.EndEdit(); } Regards Ravi >Hi Ravi, > >Please refer to the below forum thread. > >http://www.syncfusion.com/Support/forums/message.aspx?MessageID=43807 > >Let us know if you need any further assistance. > >Regards, >Calvin.


AD Administrator Syncfusion Team May 15, 2006 01:56 PM UTC

Hi Ravi, Have a check that the row index must be greater than -1 in the CurrentCellMoving event handler to see if that avoids the mentioned paint issue. private void EditableGrid_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e) { if(e.RowIndex > -1) { GridCurrentCell currentCell =this.CurrentCell; if(currentCell.RowIndex != e.RowIndex) { if(m_document.IsDirty) { if ( RowChanged != null ) { m_document.IsDirty = false; RowChanged(currentCell.RowIndex-1); } } } } } Regards, Calvin.


RA Ravichandran May 15, 2006 02:08 PM UTC

Hi Calvin, No. It didnt solve the issue. Pls refer the exception below. -------------------------------------------- Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ----------------------------- Regds Ravi >Hi Ravi, > >Have a check that the row index must be greater than -1 in the CurrentCellMoving event handler to see if that avoids the mentioned paint issue. > > >private void EditableGrid_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e) >{ >if(e.RowIndex > -1) >{ >GridCurrentCell currentCell =this.CurrentCell; > >if(currentCell.RowIndex != e.RowIndex) >{ >if(m_document.IsDirty) >{ >if ( RowChanged != null ) >{ >m_document.IsDirty = false; >RowChanged(currentCell.RowIndex-1); >} >} >} >} > >} > >Regards, >Calvin.


AD Administrator Syncfusion Team May 16, 2006 07:12 AM UTC

Hi Ravi, Sorry, I am not able to reproduce the issue here. Can you set Break into the debugger when the exception is thrown and find exactly where the exception is being thrown? Or if you can reproduce the issue in the sample in the above mentioned forum thread and send it back we can get back soon with a solution. Regards, Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon