Hi,
in my c#.net 3.5WindowsApplication i have a datagridview, in that i have a DataGridViewComboboxColumn.
i want to assign diffarent datasource to that column based on row
suppose for 1,3,4 rows i want to assign one datatable as datasource
for 2 one table
and for 5th row someothere table
means each row have its own datasource
how can i achieve this???
what i tried is:
foreach (DataGridViewRow dr in dataGridView1.Rows)
if ((dr.Index == 0) || (dr.Index == 2) || (dr.Index == 3))
Respcol.DataSource = yesnoResp();
else if (dr.Index == 1)
Respcol.DataSource = emptranPwd();
}
Respcol.ValueMember =
columnType.Resp.ToString();
---------------------------------------------------------
private DataTable yesnoResp()
{
DataTable dt = new DataTable();
dt.Columns.Add("Resp");
dt.Rows.Add("YES");
dt.Rows.Add("NO");
return dt;
}
private DataTable emptranPwd()
{
DataTable dt = new DataTable();
dt.Columns.Add("Resp");
dt.Rows.Add("LOGIN");
dt.Rows.Add("NO");
dt.Rows.Add("ALL");
return dt;
}
enum columnType
{
Resp
};
but it always taking the final row datasource to all rows...... :(
how can i assign diffarent datasources for diffarent rows combobox columns???
please if you have any idea please share
Thanks In Advance
--Naren
{