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

Keep Rows selected

3 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 29 Aug 2020, 04:19 PM

Hello

I have a gridview (with multiple select) in which a column contains updatable values.

When I select a row and update the value the row is selected bu the other rows are unselected

I woold like to keep in the selectedrows collections all the rows in which I have updated the value to be able to process all the selected rows simultaneously

Is there a way to achieve this ?

Thanks in advance

Pierre-Jean

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Sep 2020, 10:21 AM
Hello, Pierre-Jean,
 
The following help article demonstrates how you can select multiple cells/rows with user interaction: https://docs.telerik.com/devtools/winforms/controls/gridview/selection/multiple-selection 

If I understand your requirement correctly, you want to store all rows that have any modifications over the values. I don't think that multiple selection would be appropriate for this case. I would suggest you to handle the CellValueChanged event and store the affected GridViewDataRowInfo into an appropriate collection that would store all data rows that were updated. Then, if you want to process all of these rows simultaneously, you can traverse the collection and execute the desired action.

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 02 Sep 2020, 11:23 AM

Hello Dess

thanks a lot for your suggested solution.

I have investigated an alternative aproach by adding a checkbox column to replace the selected row. It is a more "readable" solution that clearly indicates to the users the rows onto which the operation will take place.

In any case I keep in mind your suggestion that might well be useful in another context.

Best Regards

Pierre-Jean

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Sep 2020, 11:51 AM

Hello, Pierre-Jean,

I am glad that you have found a suitable solution for covering your case.

However, I would like to give some additional information regarding the checkbox column which I believe you already know from the other forum thread that you have opened. I am posting the answer here as well in order the community to benefit from it.

GridViewCheckBoxColumn offers the EditMode property. This property determines whether changing a value of a check box will immediately be send to the cell (OnValueChange) or when the current cell is changed or the grid is being validated (OnCellChangeOrValidating). Feel free to set the EditMode property to OnValueChange and handle the CellValueChanged event. In this case, the event will be fired as soon as you click a checkbox and execute the desired action.

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
GridView
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or