How do I handle grid binding when the dataset is empty?
I get an error at UltraWebGrid.OnLoad() when datasource is empty.
"The IListSource does not contain any data sources."
Assuming you are using the System.Data.DataSet object.
I would assume that you could just take your DataSet object and see if you don't have any tables in it before calling databind.
if (ds.Tables.Count > 1)
webgrid.DataBind()
The behavior is similar to that of the GridView, they both will throw the same exception as it tries to bind.
I found the problem.
I had set Dataset = new dataset().
So when there was no dataset, new Dataset() was passed, in other words zero was passed.
I set Dataset to return null when there is no data. Its worknig fine.