You must Sign In to post a response.
  • Category: .NET

    DataGridView ComboBox Cell Value Clear

    Hi,

    I want to know how to clear the datagridview combobox cell item values which kept inside the datagridview.Means Clearing all the values inside the datagridview combobox column.
  • #768905
    Hi,

    If you want to clear combox values inside datagrid means you have to write the code inside itemdatabound event of datagrid.

    Ex:

    protected void void Item_Bound(Object sender, DataGridItemEventArgs e)
    {
    if(condition)
    {
    cmb.Items.Clear();
    }
    }


    Try something like above to achieve your goal.

    Hope this helps you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #768914
    Hai Muralee,
    You can use the below code to clear the combox which is inside a cell in DataGridView:

    ((DataGridViewComboBoxCell)row.Cells["Column1"]).Items.Clear()

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


Sign In to post your comments