Articles in this section

How to Set Value in Column for Selected Row of WinForms GridGroupingControl?

Record based selection


To set a value in a particular column of each selected row, you can make use of Record.SetValue method. The Grid.Table.SelectedRecords collection contains the selected records value only when the ListBoxSelectionMode is enabled in the WinForms GridGroupingControl.


C#

//Record Selection
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
 
//Button Click
for (int i = 0; i < this.gridGroupingControl1.Table.SelectedRecords.Count; i++)
{
   //Set the value of particular column  
   this.gridGroupingControl1.Table.SelectedRecords[i].Record.SetValue("A", "100");
}

VB

'Record Selection
Me.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended

 'Button Click
For i As Integer = 0 To Me.gridGroupingControl1.Table.SelectedRecords.Count 
    'Set the value of particular column  
    Me.gridGroupingControl1.Table.SelectedRecords(i).Record.SetValue("A","100")
Next i
The screenshot below displays the column value based on the selected row in GridGroupingControl

Show the selection based on the record


Reference Link:
 
Record Based Selection

 

Conclusion


I hope you enjoyed learning how to set the value in a particular column for each selected row in WinForms GridGroupingControl.

You can refer to our WinForms GridGroupingControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridGroupingControl documentation to understand how to present and manipulate data.

 

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridGroupingControl and other WinForms components.

 

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied