Hi,
I'm getting a null reference exception when trying to expand hierarchical data after moving a column on a xamDataGrid.
I am calling "xamHierarchyGrid.FieldLayouts[0].Fields.Move(startIndex, moveToIndex);" to move the column. This seems to work correctly, and the column updates and moves to the new position. However, if I try to expand the hierarchial data by clicking on the plus icon to view the subrecords after calling this a couple of times, the program crashes with the null reference exception.
I can expand and hide the data just fine before I move the column. After moving the column once, sometimes it will crash when I try to expand the data, sometimes it will work, and occasionally, it will expand but no data will show up. After moving the column 2-3 times, it will almost always crash when I attempt to expand the data.
This is the code I am calling to move the column:
int startIndex = xamSettingHierarchyGrid.FieldLayouts[0].Fields[fieldname].Index;
if (startIndex != moveToIndex)
{
xamSettingHierarchyGrid.FieldLayouts[0].Fields.Move(startIndex, moveToIndex);
}
This is the exception I get:
System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="Infragistics3.Wpf.DataPresenter.v8.1" StackTrace: at Infragistics.Windows.DataPresenter.FieldLayout.a.a() at Infragistics.Windows.DataPresenter.FieldLayout.a.b() at Infragistics.Windows.DataPresenter.FieldLayout.a.a(Field A_0) at Infragistics.Windows.DataPresenter.ExpandableFieldRecord.get_Description() at Infragistics.Windows.DataPresenter.RecordPresenter.GetRecordDescription()... etc.
Any help would be greatly appreciated, thanks.
Hi bzell,
I think that your issue deserves special attention that's whyI would advise you to use the Infragistics Developer Support Ask for Help page <http://es.infragistics.com/support/ask-for-help.aspx>You should use the online submission form to provide DS professionals with more detailed info about your issue so that they can look into the matter further.You also will need to include a simple sample application (as attachment) that demonstrates the issue. It doesn't have to be your real application - just the simplest sample that duplicates the issue.
Best Regards,Yanko
Yanko,
Thank you for responding.
1) I have attached a sample application that replicates this problem
2) When running the sample application, click the "Move Column" button at the top, then click on the + icon in the grid row to expand the sub row. This will throw the NullReferenceException about 50% of the time. If it doesn't, click the button again and collapse and re-expand the sub row.
3) The version of the Infragistics librarys we are using is 8.1
4) The OS is Windows Vista Ultimate.
I would like to assist you in solving your issue.I need the following things:
1. A simple sample application that demonstrates the issue.It doesn't have to be your real application - just attach the simplest sample that duplicates the issue.
2. Steps to reproduce the issue(through the provided sample application).When does the issue appear ?(describe what exactly you are doing)
3. What's the release version of your xamDataGrid component ?
4. What's the OS version you are running your application on ?