Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
660
Re: WinGrid custom column sorting
posted

When the user clicks a column-header, I needed to sort not only by that column but by two columns (one of them is always the same) so i found this thread and tried it, but i'm getting a NullPointerException

This is my function:

private void DfgridDokumente_BeforeSortChange(object sender, BeforeSortChangeEventArgs e)
{
UltraGridColumn colOverdue = dfgridDokumente.DisplayLayout.Bands[0].Columns["colOverdue"];
if (colOverdue != null)
{
e.SortedColumns.Insert(0, colOverdue, false); //<<-- here i'm getting a null pointer exception
}
}

When i'm in the debugger, colOverdue is set to the correct column, e.SoredColumns looks fine too

Any idea what's going wrong here?

Parents
No Data
Reply
  • 469350
    Offline posted

    dfboris said:
    colOverdue is set to the correct column, e.SoredColumns looks fine too

    Well, if neither of those is null, then there's no way for me to guess what's happening there. Does the call stack of exception point to some other method or event handler?

Children