C# DataGridView Check if empty

后端 未结 7 1817
故里飘歌
故里飘歌 2020-12-17 15:01

I have a datagridview which gets filled with data returned from a linq query. If the query returns no results I want to display a messagebox. Is there a way of checking to s

相关标签:
7条回答
  • 2020-12-17 15:43

    You can check the Rows.Count property of the datagridview.

    Although you might also want to look into the EmptyDataText property of the DataGridView. It might save you showing a messagebox.

    0 讨论(0)
提交回复
热议问题