R
ReneMarxis
Hello
i have some simple question on DataGridView.
I use a DataGridView to display some data (databound) and can't get 2
things working:
1) i want to show just some of the columns not all
2) i want to change the colum-header text
2) i want to rearrange the columns
For 1) and 2) i counld just set the Column.Visible flag to false and
use the HeaderText property (which works)
But i can t get point 3) running.
I thought of using a DataView for solving all 3 problem but it seems
like i misunderstood the meaning of that DataView object
Heres the code i use to fill the grid:
DBLists dbLists = new DBLists();
Kunden kdList = new Kunden();
DataSet ds;
BindingSource bsKunden;
DataView dv
ds = new DataSet();
kdList.oleDA.Fill( ds, "Kunden" ); //use the DataAdapter
bsKunden = new BindingSource( ds, "Kunden" );
dgKunden.DataSource = bsKunden;
dv = new DataView( ds.Tables["Kunden"] );
bsKunden.DataSource = dv;
dgKunden.DataSource = bsKunden; //set the DataSource of the grid
Can anyone give me some hints? At least for the 3) problem.
PS: I can't/don't want to change the select statement of the
DataAdapter, as it is used often in the project but i need to display
the data in different order.
_thanks in advance rene
i have some simple question on DataGridView.
I use a DataGridView to display some data (databound) and can't get 2
things working:
1) i want to show just some of the columns not all
2) i want to change the colum-header text
2) i want to rearrange the columns
For 1) and 2) i counld just set the Column.Visible flag to false and
use the HeaderText property (which works)
But i can t get point 3) running.
I thought of using a DataView for solving all 3 problem but it seems
like i misunderstood the meaning of that DataView object
Heres the code i use to fill the grid:
DBLists dbLists = new DBLists();
Kunden kdList = new Kunden();
DataSet ds;
BindingSource bsKunden;
DataView dv
ds = new DataSet();
kdList.oleDA.Fill( ds, "Kunden" ); //use the DataAdapter
bsKunden = new BindingSource( ds, "Kunden" );
dgKunden.DataSource = bsKunden;
dv = new DataView( ds.Tables["Kunden"] );
bsKunden.DataSource = dv;
dgKunden.DataSource = bsKunden; //set the DataSource of the grid
Can anyone give me some hints? At least for the 3) problem.
PS: I can't/don't want to change the select statement of the
DataAdapter, as it is used often in the project but i need to display
the data in different order.
_thanks in advance rene