This is a migrated thread and some comments may be shown as answers.

MultiValue update in Gridview

2 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ramraj
Top achievements
Rank 1
Ramraj asked on 25 Sep 2015, 08:55 AM

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 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 25 Sep 2015, 01:55 PM
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
0
Ramraj
Top achievements
Rank 1
answered on 28 Sep 2015, 03:04 PM

Thanks

It worked perfectly.

Tags
GridView
Asked by
Ramraj
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Ramraj
Top achievements
Rank 1
Share this question
or