Hi
I would like to know how I can use a GridView.DataSource with a GridViewComboBoxColumn.
private DataTable GridVDataSource = new DataTable();
**
**
This.GridView1.DataSource = GridVDataSource;
**
**
// Update GridView1 DataSource
private void button1_Click(object sender, EventArgs e)
{
GridVDataSource = " SQL operations ("SELECT StateID FROM State")";
}
However the StateID Column must be a combobox.
How can I change the column type to keep the combobox at each DataSource refresh?
If I created the column before :
private void form1_Load(object sender, EventArgs e)
{
GridViewComboboxColumn Combo = new GridViewComboboxColumn("StateID","");
Combo.DataType = typeof(int);
Combo.DataSource = StateDataSource; // Loaded before
Combo.DisplayMember = "StateName";
Combo.ValueMember = "StateID";
this.GridViewLanguages.Columns.Add(Combo);
}
When I refresh the DataSource (button1_Click) the GridView add the DataSource columns like news columns.
So, how is it possible to keep the initial combobox columns or to change them after loading the column type?
Thanks