[RESOLVED] DefaultView.Sort is resetting
I need help with this code:
After execution, the "DataSet1.Tables.DefaultView.Sort" property is reset to empty string.
DataSet1.Tables.DefaultView.Sort = "sortcolumn";
BindingSource1.DataSource = DataSet1.Tables.DefaultView;
What might be the cause of this, and how can this be avoided?
Re: DefaultView.Sort is resetting
The problem was that in the designer window, when I previously set the Sort property of the BindingSource to some value, and then later I deleted it, the designer was initializing it's value to an empty string, not to null, which was causing the problem.
I just deleted the initialization for the Sort property from the designer code (I suppose you can't set the value to null from the designer window).
The issue is solved.