Datagridview

  • Thread starter Thread starter R.A.F.
  • Start date Start date
R

R.A.F.

Hi,

I have a really stupid question about DataGridView.
how dynamically create and display it on the form ?

i tried :

DataGridView myGrid = new DataGridView();
myGrid.Columns.Add("col1", "Column 1");
myGrid.Show();

but it does not work, so i miss something, but what ?
i've read the documentation but i did not find something :-(

thanks a lot,

RAF
 
RAF,

You aren't binding any data to the grid, so it won't show anything. You
have to bind a data source to the grid.
 
Well, for the grid to be practical, it will be necessary to bind SOME
sort of data to it. It wasn't clear from your original post whether you
were adding the grid to the controls or not, or if it was because you
weren't seeing any data.
 
so sorry if it was not clear... for sure i will add data but not
necessary from database or table.
:-)
 
Back
Top