I have devexpress gridcontrol which I want to fill with data from predefined DataTable. This is my code:
private void SortDataTable()
{
DataView dv = GetDataTejbl.DefaultView;
dv.Sort = comboEdit.Text + " " + "DESC";
DataTable SortedDataTable = dv.ToTable();
gridControl1.DataSource = SortedDataTable;
}
The error I get:
"Object reference not set to an instance of an object."
- check to determine if the object is null before calling the method
- use the "new" keyword to create an object instance
- get general help for this exception
Any help would be appreciated. Thank you very much
EDIT: The code I've tried
if (GetDataTejbl.Rows.Count > 0)