How to change value in cell and background of row, based on a checkboxselection
In my datagrid, one column is a checkbox and there are two things that I There are two things I am looking for
1. How do I change the background color for the entire row, based on if the checkbox column BulkUpdate is check or not.
2. How do I uncheck the BulkUpdate checkbox column in each row?
I have attached my project, that has the questions imbedded within
Attachment: SyncfusionsfDatagrid_648eef44.zip
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
MA
Mohanram Anbukkarasu
Syncfusion Team
April 6, 2021 07:42 AM UTC
Hi Karla Franke,
Thanks for contacting Syncfusion support.
We are unable to load data in the provided sample. It displays messagebox as given below.
However please find the solutions given below for the mentioned queries.
|
Query |
Solution | |
|
1. How do I change the background color for the entire row, based on if the checkbox column BulkUpdate is check or not. |
You can achieve this by using QueryRowStyle event a shown in the following code example.
Code example :
| |
|
2. How do I uncheck the BulkUpdate checkbox column in each row? |
You can change the check box value of the row when double clicking on it as shown in the following code example.
Code Example :
|
Sample link : https://www.syncfusion.com/downloads/support/forum/164239/ze/SfDataGrid_GridCheckBoxColumn_VB-160313074
Please let us know if you require further assistance from us.
Regards,
Mohanram A.
Marked as answer
KF
Karla Franke
April 6, 2021 01:07 PM UTC
I apologize for not attaching a working project.
In regards to the second question "How do I uncheck the BulkUpdate checkbox column in each row? "
Let's say I have 10 rows in my datagrid.
Rows 1, 2 and 3 have the BulkUpdate checkbox column checked.
If I double click in the 6th row, How do I uncheck the BulkUpdate checkbox in rows 1, 2 and 3? Or how do I uncheck all the rows in my datagrid?
Your example uses e.DataRow.RowData but that only references the row that was double-clicked in.
MA
Mohanram Anbukkarasu
Syncfusion Team
April 7, 2021 12:29 PM UTC
Hi Karla Franke,
Thanks for the update.
You can achieve this by setting the BulkUpdate value for all the needed rows as shown in the following code example.
Code example :
|
For Each item In Me.sfDataGrid1.View.Records
Dim bulkUpdate = CBool(Me.sfDataGrid1.View.GetPropertyAccessProvider().GetValue(item.Data, "BulkUpdate"))
If bulkUpdate Then
Me.sfDataGrid1.View.GetPropertyAccessProvider().SetValue(item.Data, "BulkUpdate", False)
End If
Next item |
Please let us know if you require further assistance from us.
Regards,
Mohanram A.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
KF Karla Franke
- Apr 5, 2021 10:56 PM UTC
- Apr 7, 2021 12:29 PM UTC