c# windows application
Hi,Actually my problem was how to update combo box in datagridview and after update i want to display that update data on combo box (display text) in the same datagridview plz help me out from this problems thanks in advance,no body gave answer to this is question so am requesting thanks in advance.........
Sudhakar ChaudharyPosted Dec 25, 2012, 2:32 PM
ComboBox Column For datagridview
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
sSql = "SELECT F_FALLON FROM AMS WHERE A_CODE='" + dataGridView1.Rows[i].Cells[6].Value.ToString() + "'";
ds = objQuery.GetData(sSql);
string Fallon = ds.Tables["s"].Rows[0].ItemArray[0].ToString();
DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[3];
if (Fallon == "A")
{
cell.Value = "ASSET";
}
else if (Fallon == "L")
{
cell.Value = "LIAL";
}
else if (Fallon == "I")
{
cell.Value = "INCOME";
}
else if (Fallon == "E")
{
cell.Value = "EXPENDITURE";
}
}
/// method for Filling Grid Combobox
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
sSql = "SELECT F_FALLON FROM AMS WHERE A_CODE='" + dataGridView1.Rows[i].Cells[6].Value.ToString() + "'";
ds = objQuery.GetData(sSql);
string Fallon = ds.Tables["s"].Rows[0].ItemArray[0].ToString();
DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[3];
if (Fallon == "A")
{
cell.Value = "ASSET";
}
else if (Fallon == "L")
{
cell.Value = "LIAL";
}
else if (Fallon == "I")
{
cell.Value = "INCOME";
}
else if (Fallon == "E")
{
cell.Value = "EXPENDITURE";
}
}
sampath katkuriPosted Dec 25, 2012, 11:04 PM