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

Validating in GGC grid with Hierarchy

I am not sure what is causing this behaviour: I have set up validation and the error message is reported to user when I in my validating event handler and I set cancel to true and I set the errormessage on the current cell and THEY CLICK ON ANY RECORD THAT IS AT THE SAME LEVEL OR BELOW IN THE HIERARCHY. If they click on a parent row or the parent''s row siblings or any of its children the validating event handler is called but the message box with the error is never shown. Any ideas?

3 Replies

AD Administrator Syncfusion Team August 18, 2005 09:13 AM

There is an exception being raised in the situation you described that is causing the message to fail to appear. We will look into how to handle this issue in our code. Until we do, I think you can get the message to display by handling TableCOntrolCurrentCellMovedFailed, and displaying it there yourself.
private void gridGroupingControl1_TableControlCurrentCellMoveFailed(object sender, GridTableControlCurrentCellMoveFailedEventArgs e)
{
	e.TableControl.CurrentCell.Lock();
	MessageBox.Show("Cannot move");
	e.TableControl.CurrentCell.Unlock();
	e.TableControl.CurrentCell.ErrorMessage = "";
}


BC Brian Corley August 18, 2005 01:03 PM

This does not solve the problem. The grid still allows for a new record to be selected. I get the following unhandled exception; System.InvalidCastException: Specified cast is not valid. at Syncfusion.Grouping.CurrentRecordManager.NavigateTo(Record record) at Syncfusion.Grouping.Record.SetCurrent(String fieldName) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlSelectRecords.ChangeSelectCells(Int32 rowIndex, Int32 colIndex) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlSelectRecords.MouseMove(GridTableClickCellsEventArgs te) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.ProcessTableClickCellsMouseMove(GridTableClickCellsEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableClickCellsMouseController.MouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridNestedTableControlCellRenderer.OnMouseMove(Int32 rowIndex, Int32 colIndex, MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.RaiseMouseMove(Int32 rowIndex, Int32 colIndex, MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableClickCellsMouseController.MouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.MouseControllerDispatcher.ProcessMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.ScrollControllMouseControllerDispatcher.ScrollControlMouseMoveHandled(Object sender, MouseEventArgs e) at Syncfusion.Windows.Forms.ScrollControl.OnScrollControlHandledMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.ScrollControl.OnMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.GridControlBase.OnMouseMove(MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(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 Syncfusion.Windows.Forms.Grid.Grouping.GridTableControl.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)


AD Administrator Syncfusion Team August 18, 2005 05:30 PM

Here is a sample that will not let you edit any cell (validation fails) and you get the message no matter where you click in the grid. http://www.syncfusion.com/Support/user/uploads/GGC_MinimalNestedtables_2df8544a.zip Is this what you tried?

Loader.
Live Chat Icon For mobile
Up arrow icon