I have an issue on an ultra grid on my application.
The grid has a group by row setting as such:
The cells that can be seen can be selected and multiple cells can be selected when the user drags across. When the user drags the cells and drags it upwards towards the group by row in this example is the 'Asset type xxxx', the application crashes with the following exception:
************** Exception Text **************System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.UltraGrid.Infragistics.Win.ISelectionManager.ItemNearestPoint(Point point, ISelectableItem lastItem) at Infragistics.Win.SelectionStrategyExtended.OnMouseMove(ISelectableItem item, MouseMessageInfo& msginfo) at Infragistics.Win.SelectionStrategyExtended.OnMouseMessage(ISelectableItem item, MouseMessageInfo& msginfo) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there anything I can do to fix this? I am using VB.
Thank you for contacting Infragistics!
I have some follow up questions concerning this matter. How are you enabling drag and drop for the cells? How are you otherwise setting up the grid? Do you group a column before dragging the cells to the group by area? What version are you using?
Here are some of the settings set on the grid:
Grid.DisplayLayout.ViewStyle = Infragistics.Win.UltraWinGrid.ViewStyle.MultiBand Grid.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy Grid.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.None
Grid.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect Grid.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.Extended Grid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None
The grouping is done in code, not from the UI.
.DisplayLayout.Bands(0).Columns("AssetType").Header.Caption = "Asset Type".DisplayLayout.Bands(0).SortedColumns.Add(Me.grdVehicleAvailability.DisplayLayout.Bands(0).Columns("AssetType"), False, True)
I believe we are on version 11.2.
Thank you for the update.
Looking at the code you have provided there doesn’t appear to be anything there that would let you drag two columns or cells into the group by area to cause this area. It would let you select multiple cells but not drag them. The best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally.