Windows Forms - DataGridView - Empty Row

G

Guest

I have a Windows Application that uses a DataGridView for displaying
read-only data. Everything work fine, except when my datasource has no data.
Ideally, when there is no data I would like to display the column headers
with no data rows, but instead it displays the headers with an empty data
row, which leads the user to believe that there is data when there isn't any.
Does anyone know how to hide this empty row? (I already have
AllowUserToAddRows set to false.)
 
C

Cor Ligthert [MVP]

Bryan,

You can use a dataview as datasource and set in that allownew to false.

I hope this helps,

Cor
 
G

Guest

I tried that as well, but the DataGridView still creates an empty row, even
though the DataTable/DataView.Rows.Count=0.
 

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

Top