DataGridView with datatable, how prevent view all column?

  • Thread starter Thread starter mtczx232
  • Start date Start date
M

mtczx232

Datagrid view bound to datatable, view all fields from table, even I
add some column to DataGridView. to prevent it I must add all clolumn
to grid and set them unvisible except the column that I want to be
visible.

Have beter way to do that
 
Set the grid's AutoGenerateColumns property to false. Then it will
only display columns you define instead of every column in your data
source.
 
Back
Top