We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Microsoft Datagridview and Syncfusion Splitbutton behaviour

Thread ID:

Created:

Updated:

Platform:

Replies:

146510 Aug 6,2019 04:33 PM UTC Aug 28,2019 07:30 AM UTC WinForms 3
loading
Tags: SplitButton
Sauro
Asked On August 6, 2019 04:33 PM UTC

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

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


Subburaj Pandian Veluchamy [Syncfusion]
Replied On 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 Veluchamy [Syncfusion]
Replied On 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  


Jagadeesan Pichaimuthu [Syncfusion]
Replied On 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: 
 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Jagadeesan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon