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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

unexpected or unpredictable behavior of UnBoundRow

Thread ID:

Created:

Updated:

Platform:

Replies:

130041 Apr 18,2017 07:14 AM UTC Apr 19,2017 05:11 PM UTC WPF 1
loading
Tags: SfDataGrid
Amit Saraf
Asked On April 18, 2017 07:14 AM UTC

I'm using sfDataGrid where complete code is written in c# (not in XAML)

when user runs app and try to refresh data multiple time then code written in 

void LV_QueryUnBoundRow(object sender, sync.Grid.GridUnBoundRowEventsArgs e) 
{
     //----
}

runs the number of time user has previously refreshd grid 

for more explanation I'm attaching sample code
please keep an eye on top row values you will understand what I want to say

Amit Saraf

Attachment: sfDataGridUnboundRow_fd5d59ff.zip

Sivakumar R [Syncfusion]
Replied On April 19, 2017 05:11 PM UTC

Hi Amit Saraf, 

Thank you for contacting Syncfusion support. 

We have analyzed your provided sample. You have subscribed to QueryUnBoundRow whenever you click the button, so handler triggered multiple time. You can achieve your requirement by unsubscribing the QueryUnBoundRow event before subscribing again as in the below code., 
Code Snippet: 

private void btnRefresh_Click(object sender, RoutedEventArgs e) 
{ 
    tcount = 0; 
    LV.QueryUnBoundRow -= LV_QueryUnBoundRow; 
    LV.QueryUnBoundRow += LV_QueryUnBoundRow; 
    LV.Columns.Clear(); LV.UnBoundRows.Clear(); LV.TableSummaryRows.Clear(); 
    LV.ItemsSource = null;             
    LV.UnBoundRows.Add(new sync.Grid.GridUnBoundRow { Position = sync.Grid.UnBoundRowsPosition.Top }); 
    LV.UnBoundRows.Add(new sync.Grid.GridUnBoundRow { Position = sync.Grid.UnBoundRowsPosition.Top }); 
 
    LV.ItemsSource = GenDT(); 
} 


Please let us know if you have any query. 

Regards, 
Muthukumar K 


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.

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

;