Microsoft Datagridview and Syncfusion Splitbutton behaviour
Hi,
on a winform I have placed a Ms Datagridview with checkboxes and one Ms button.
If I check on a row of datagridview and then I click the Ms button the following code works correctly
Protected Function GetGrdFattureSelectedIds() As List(Of Integer)
'Get the list of selected id
Dim L As New List(Of Integer)
For Each Row As DataGridViewRow In grdFatture.Rows
If Row.Cells("Selezionato").Value = True Then L.Add(Row.Cells("idDocumento").Value)
Next
Return L
End Function
For Each Row As DataGridViewRow In grdFatture.Rows
If Row.Cells("Selezionato").Value = True Then L.Add(Row.Cells("idDocumento").Value)
Next
Return L
End Function
I have placed a Syncfusion splitbutton and that routine fails the value of the last checked row: If I check only one row returns no items if I check three rows it returns the first two rows only. It seems that splitbutton doesn' t allow the datagridrow to complete events chain.
Any idea? thanks
SIGN IN To post a reply.
3 Replies
SP
Subburaj Pandian Veluchamy
Syncfusion Team
August 7, 2019 01:51 PM UTC
Hi Sauro,
Thank you for contacting Syncfusion support.
Based on the provided information, currently we are analyzing the issue. We will validate and let you know the details in two business days (August 9, 2019). We appreciate your patience until then.
Regards,
Subburaj Pandian V
Subburaj Pandian V
SP
Subburaj Pandian Veluchamy
Syncfusion Team
August 9, 2019 12:07 PM UTC
Hi Sauro
Thank you for your patience.
We have analyzed your reported behavior “MS DataGridView cell value is not updated properly when looped using SplitButton click” and we have confirmed it is a defect. We have logged a report for the same and the patch for this fix is estimated to be available on or before August 28, 2019. We appreciate your patience until then.
You can tract the status of this report using the following feedback link:
Note: The provided feedback link is private, and you need to login to view this feedback.
Regards,
Subburaj Pandian V
Subburaj Pandian V
JP
Jagadeesan Pichaimuthu
Syncfusion Team
August 28, 2019 07:30 AM UTC
Hi Sauro,
Thanks for your patience.
We have checked the reported case related with “MS DataGridView cell value is not updated properly when looped using SplitButton click” and it has been found that it is behavior of custom controls which is derived from Control. Our SplitButton control is derived from the Control, its Click action would perform directly using the Window process message, so the changed cell of DataGridView is in dirty state and the focus is in current cell and not anywhere. Hence the cell value does not get changed and updated. Whereas the Button is derived from the ButtonBase control, whose click action would be invoked at the MouseDown event and then it has been processed by the Window process message. So the focus would lost and the cell value get correctly committed. We have also checked the behavior with the custom control and it also behaves the same and it has been given in the below sample.
So we have worked further on this and prepared the workaround to get the committed the cell value which is in dirty state using the CurrentCellDirtyStateChanged event of MSDataGridView using the following code:
Code Snippet:[C#]
|
private void DataGridView1_CurrentCellDirtyStateChanged(object sender, System.EventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 0 && dataGridView1.IsCurrentCellDirty)
{
dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
}
|
Please download the sample and video for your reference:
Sample: https://www.syncfusion.com/downloads/support/forum/146510/ze/MSDataGridViewWorkaround1902629069
Video: https://www.syncfusion.com/downloads/support/forum/146510/ze/SplitButtonworkingvideo-1874256173
Please try this solution and let us know if it is helpful.
Regards,
Jagadeesan
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
SA Sauro
- Aug 6, 2019 04:33 PM UTC
- Aug 28, 2019 07:30 AM UTC