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
145
Binding an empty dataset to ultrawebgrid
posted

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."

Parents
No Data
Reply
  • 21382
    posted

    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.

Children
No Data