Remove Item in datagridcombocell
  • Hello i want to remove a item from datagridcombocell which is use on another row in same cell like this

    when i select qw2120 so on next row it will not display the same item on combo cell

    how its possible? here is my code



    lstCombo.Clear();
     foreach (DataRow dr in dt.Rows)
    {
    lstCombo.Add(dr.Field<string>("ProductCode").ToString());
    }
    foreach (DataRow dr in dt.Rows)
    {
    if (e.RowIndex == 0)
    ProductCode.Items.Add(dr.Field<string>("ProductCode").ToString());
    else
    {
    ProductCode.Items.Clear();
    int i = 0;
    foreach (var item in lstCombo)
    {
    if (item.ToString() == dgDetail.Rows[e.RowIndex - 1].Cells["ProductCode"].Value.ToString())
    lstCombo.RemoveAt(i); break; 
    }
    else i++;
    }
    foreach (var items in lstCombo) ;
    }
    }
    hussainroyal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week

Top Posters Weekly

Optimum Creative