MultiValue update in Gridview

3 posts, 0 answers
  1. Ramraj
    Ramraj avatar
    1 posts
    Member since:
    Sep 2015

    Posted 25 Sep 2015 Link to this post

    Hi 

     

    I have a grid view in which it has a combo box in some cell

    & i can select multiple rows,now my query is that is there any way that when i select multiple row & then change the combo box value of one row it should automatically set the value of combo box to all the row which are selected through multiple option.

     

    Thanks

    Regards

    Ramraj Gupta

     

     

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 25 Sep 2015 Link to this post

    Hello Ramraj,

    Thank you for writing.

    You can achieve this task by subscribing you RadGridView to the CellValueChanged and in the handler iterate the selected rows and set the values of the cells in your combo column:
    private void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e)
    {
        if (e.Column.Name == "MyComboColName")
        {
            foreach (GridViewRowInfo row in this.radGridView1.SelectedRows)
            {
                if (row.Cells["MyComboColName"].Value != e.Value)
                {
                    row.Cells["MyComboColName"].Value = e.Value;
                }
            }
        }
    }

    Please also check the following documentation article: Iterating Rows.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ramraj
    Ramraj avatar
    3 posts
    Member since:
    Sep 2015

    Posted 28 Sep 2015 in reply to Hristo Merdjanov Link to this post

    Thanks

    It worked perfectly.

Back to Top