Home Forums WinForms controls Xceed Grid for WinForms Exception at GridControl.DataRows.Clear()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #16644 |

    We have encountered a rather frustrating null reference exception that is being thrown while attempting to call GridControl.DataRows.Clear().
    Stack trace:

        at Xceed.Grid.Row.GetParentGridFromContainingList(IStructuredList structuredList)

       at Xceed.Grid.DetailGrid.IsParentOf(Row row)

       at Xceed.Grid.DetailGrid.ClearGridBody(Boolean unbindSubGrid)

       at Xceed.Grid.DetailGrid.DataManager_DataRowsChanged(DataRowsChangedEventArgs e)

       at Xceed.Grid.DataManager.InvokeOnDataRowsChanged(DataRowsChangedEventArgs e)

       at Xceed.Grid.Collections.DataRowList.OnClearComplete()

       at Xceed.Utils.Collections.ListBase.InternalClear()

       at Xceed.Utils.Collections.ListBase.ListClear()

       at Xceed.Grid.Collections.DataRowList.Clear()

       at SmcManager.ScriptMaintenance_Form.LoadScripts(Int32 selectedScriptId) in C:\dev\smc\HolidayInn\SmcManager\ScriptMaintenance_Form.cs:line 137 

     Please advise; I am ready and willing to supply more context.


    Imported from legacy forums. Posted by evang (had 768 views)

    User (Old forums)
    Post count: 23064

    I don’t know why this happened the way it did, but I had subscribed to the two Sort-related events and the exception was actually caused by my code (I was using GridControl.SelectedRows.ResetTo(row) and “row” did not belong to the grid- the gridcontrol was calling the _Sorted event when I did not expect it to). It took some realy digging, as the exception that was thrown was misleading and I had to get creative in finding the solution.

    Imported from legacy forums. Posted by evang (had 1228 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.