Repost: DataGrid with no rows

K

kgs

I get argument out of range exception when my datasource
does not have any rows to display in datagrid.

Right now if there are no rows i get a
blank area of datagrid. no header no footers.

what should i do to display header only without any rows.
here is the snippet of code.

Try

mydataGrid.DataSource = myDS
mydataGrid.DataBind()
Catch
--No rows. just display only header.
End Try
Appreciate any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top