Hi All,
I am using DataGridview and there is a Combobox column is present in the datagrid.
I am binding the
DataGridViewComboboxcolumn with a DataSource.
DataGridViewComboBoxColumn cmbInstType = (DataGridViewComboBoxColumn)grdCashMemoDetails.Columns["grdCashMemoDetailsInstrumentType"];
DataTable instType = new DataTable(); "Value", typeof(int)); "Display", typeof(String)); "Cash"); "Card"); "DD"); "Cheque"); "Display"; "Value";
instType.Columns.Add(
instType.Columns.Add(
instType.Rows.Add(1,
instType.Rows.Add(2,
instType.Rows.Add(3,
instType.Rows.Add(4,
cmbInstType.DisplayMember =
cmbInstType.ValueMember =
cmbInstType.DataSource = instType;
Now I want to set the default selected value for the combobox as
grdCashMemoDetails.Rows[e.RowIndex].Cells[(
int)enmGridViewColumnIndex.InstrumentType].Value = 2; But this is not working.
Please guide me how to do this.
Gyanendar