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

multiple cell selection read/write

1 Answer 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sri
Top achievements
Rank 1
Sri asked on 07 Oct 2011, 05:01 PM
Hi,

Need help with radgridview control.

I need to select multiple cells in the radgridview and need to update those selected cells values in the database.

Detailed Explanation:

Please find my screenshot as attached.You can see my multiple cell selection in the radgridview and outside the radgridview I have a RadComboBox and a Radbutton(named as check).

1.First I need to select the multiple cells in the radgridview.
2.When I select the multiple cells and choose the value in RadComboBox (lets say 6 ,as appear in the screenshot) and click the check button,the all selected cells should be updated to '6' and save in the database.
3.where ever I select the multiple cells and select the value in the combobox and check the button I need to update those cells with that particular value in the database.

plz find the screen short and the sample project.

Let me know if you have any questions ? please help me with this..Appreciate your help.

Thanks,
Sri.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 12 Oct 2011, 12:02 PM
Hi Sri,

 As I understand you would like to select multiple cells. Then select  value with which these cells to be updated. Then click on a 'Check' RadButton click and update the cells with the new value.

This could be done like so:

private void Check_Click(object sender, RoutedEventArgs e)
       {
           foreach (GridViewCellInfo cellInfo in clubsGrid.SelectedCells)
           {
               Club item = cellInfo.Item as Club;
               // set the value from the combo box, 8 in this case
               item.StadiumCapacity = 8;
     // update the item in the Database
           }
       }

Is this what are you looking for? 
All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Sri
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or