Which event is best to trap for the following:
I have a grid with two columns: one is a line number, the next is a product number. The user can enter either the line number or the product number, and my code will populate the rest of the row's cells. However, if the user enters a line number I want to control where the focus goes (in this case, I want to move from column 3, the line sequence number, to column 15, the quantity column).
I found the MoveTo() method, but it always returns False when I try to call it.
What's the best way to do this?
For the new row, the IsInMoveTo property seems to be false, and the MoveFromColIndex property throws an exception in the watch window (although I can see that the protected/private moveFromColIndex member variable is 3).
I can access these properties in CurrentCellMoving. Should I use this event?
ADAdministrator Syncfusion Team February 19, 2003 06:07 AM
I don't think CurrentCellMoving would be a good place for this as you would start another move before you completed the current move.
I tried the suggestion in a GridControl before I posted it and it seemed to work there in the CurrentCellMoved event. It sounds like you might be using a GridDataBoundGrid. Attached is a sample that seems to work for that grid.
BOBruce OnderFebruary 19, 2003 09:14 AM
Thanks for the sample. I'm comparing it against mine to see why I am getting different behavior.
One thing I noticed is that some of the properties I see on your grid, such as Model.Options.WrapCell, are not available on my GridDataBoundGrid.
My version of the Grid dll is 22.214.171.124. Can this be related to my issues?
BOBruce OnderFebruary 19, 2003 09:19 AM
Duh, never mind. I only have one DLL on my machine, so it's obviously not a versioning issue. However, I am curious as to why some of these properties are not surfaced. Are some properties not exposed to VB.NET (that's what my app is written in)?
ADAdministrator Syncfusion Team February 19, 2003 09:49 AM
The wrapcell property is in the 126.96.36.199 release which is available from your support home page. If you are using an eval version, there will be a new eval posted in the next few days using the newer code base.
In general, there are properties marked Advanced that will not appear in Intellisense with the VB editor. You can change this setting under Tools|Options|Text Editor|Basic in Visual Studio. There are only a very few (about 8 out thousands) of properties marked EditorBrowsableState.Advanced in teh Grid source code. WrapCell is not one of them.
Attached is both a VB sample and a C# sample.