Keep Rows selected

4 posts, 0 answers
  1. pierre-jean
    pierre-jean avatar
    141 posts
    Member since:
    Apr 2011

    Posted 29 Aug Link to this post

    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

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3952 posts

    Posted 02 Sep Link to this post

    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).

  3. pierre-jean
    pierre-jean avatar
    141 posts
    Member since:
    Apr 2011

    Posted 02 Sep in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3952 posts

    Posted 02 Sep Link to this post

    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).

Back to Top