Windows Forms - DataGridView - Empty Row

  • Thread starter Thread starter Guest
  • Start date Start date
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.)
 
Bryan,

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

I hope this helps,

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