Riddle me this... Why does the ultragrid throw the following exception when attempting to add a datarow to the selected rows collection when a groupbyrow is selected first?
"Below Exception":
System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinGrid.Selected.SelectionPositionSortComparer.CompareRow(UltraGridRow rowX, UltraGridRow rowY) at Infragistics.Win.UltraWinGrid.Selected.SelectionPositionSortComparer.CompareRow(UltraGridRow rowX, UltraGridRow rowY) at Infragistics.Win.UltraWinGrid.Selected.SelectionPositionSortComparer.CompareRow(UltraGridRow rowX, UltraGridRow rowY) at Infragistics.Win.UltraWinGrid.Selected.SelectionPositionSortComparer.System.Collections.IComparer.Compare(Object x, Object y) at Infragistics.Win.Utilities.ComparerWrapper`1.Compare(T x, T y) at Infragistics.Win.Utilities.SortMergeHelper[T](T[ arr, T[ tmpArr, IComparer`1 comparer, Int32 si, Int32 ei) at Infragistics.Win.Utilities.SortMerge(Object[ arr, Object[ tmpArr, IComparer comparer, Int32 si, Int32 ei) at Infragistics.Win.Utilities.SortMerge(Object[ arr, IComparer comparer) at Infragistics.Win.UltraWinGrid.SelectedRowsCollection.AddRange(UltraGridRow[ rows, Boolean ensureRowsOrdered, Boolean fireSlectionChangeEvent) at Infragistics.Win.UltraWinGrid.SelectedRowsCollection.Add(UltraGridRow row) at BryceCorp.Win.ShopFloorUI.LabelReprintWizard.selectLabelGrid_InitializeRow(Object sender, InitializeRowEventArgs e) in C:\Users\dward\Documents\Visual Studio 2008\Projects\ShopFloorUIWIN\ShopFloorUIWIN\LabelReprintWizard.cs:line 400
Again this is just for curiosity, my current work around is to "unselect" the groupby row before the user attempts to select new datarows; And could some one please explain the functionality of the Expansion Indicators that run the length of the left side of the grid? I realize they look nice but do they really need to activate the group row they are attached to? is there a way to shut that functionality off so the user must click the group row itself? I've spent too much time today parsing the UIelements and I can not seem to find this particular element.
Hi,
You can't select both GroupBy and non-Group rows in the grid at the same time. This will not work through the UI and it should not work in code.
Having said that, the exception that you are getting here is not very useful or informative and should probably be corrected to display more meaningful information about why it occurred. You should Submit an incident to Infragistics Developer Support so they can get this corrected.
dward1982 said:Again this is just for curiosity, my current work around is to "unselect" the groupby row before the user attempts to select new datarows; And could some one please explain the functionality of the Expansion Indicators that run the length of the left side of the grid? I realize they look nice but do they really need to activate the group row they are attached to? is there a way to shut that functionality off so the user must click the group row itself? I've spent too much time today parsing the UIelements and I can not seem to find this particular element.
The ExpansionIndicator is inside the GroupByRow and any click within the GroupByRow selects the row. I don't think there is any way to turn this off. If you want to find the UIElement for any part of any Infragistics Winforms control, then I recommend you download the Infragistics UIElementViewer Utility. This will allow you to mouse over an element and see what it is - it's really quite amazing. :)
Mike, that is awesome stuff, I did not know about the UIElementViewer Thank You!.
Ahhh with the help of your handy dandy uielement viewer problem is solved.
Just in case any one else needs this in the future, here is the solution.
{
Point pt = new Point(e.X, e.Y);
Grid.Selected.Rows.Clear();
Grid.Selected.Rows.Add(Row);
}
Thanks again Mike
Did the UIElementViewer worked for you..I downloaded it...but it is not working..Basically i want to change the color of the Connector which connects the group in the group box (outlookgroup by box)
Can u Help please. I don't know what is the Element called..Please find attached the screenshot.
Looking forward for your reply
ultraGrid1.DisplayLayout.GroupByBox.ButtonConnectorColor = Color.Green;
Heh. Even I can learn something new about the grid. I had no idea there was a property for that. :)
Hi Dward,
Thank u very much for the prompt reply. It did work.