Drop down Combobox inside datagridview
ive been strugling with this problem for too long now, ive seen all the
answers on the subject and though ive found several none of them seems to
work for me. So the base of my problem is as follows: I have a
datagridview that will add a row to itself once another datagridview cell
is double clicked. When this datagridview gets the row added, it adds 2
types of columns to itself one is a combobox, wich suposedly has a
colection already set in it (just went to the combobox options inside the
datagrid and filled up its collection) and a check box column, now both of
them do nothing once i click on them, doble clic, multiple click as many
clics as u want but nothing happens. Ive even tryed the following code.
public static void combolist(DataGridView combogrid)
{
var column = new DataGridViewComboBoxColumn(); DataTable data = new
DataTable();
data.Columns.Add(new DataColumn("Value", typeof(string)));
data.Columns.Add(new DataColumn("Description", typeof(string)));
data.Rows.Add("item1");
data.Rows.Add("item2");
data.Rows.Add("item3");
column.DataSource = data;
column.ValueMember = "Value";
column.DisplayMember = "Description";
combogrid.Columns.Add(column);
}
and even though i can add a new column of the type combobox to my
datagridview it is still empty(or apears to be since i cant clic to see a
drop down list). my datagridview properties are set
to:editMode:editOnEnter, readOnly:false. Is there something im missing
here? why cant i populate or display this combobox?, plz this problem is
driving me crazy, and i believe this is the best site to find an answer. I
would preaty much apreciate it... a lot.
No comments:
Post a Comment