Update previous saved schemas with columns added on an SfDataGrid

If there's an SFDataGrid for which the user has saved several schemas on date X, and I (as the developer) add a column on the grid on a date after date X (for example, the schemas were saved on March 3 and I added the grid column today, March 5)... 

Is it possible to update the previously saved schema with the new grid columns? Not serializing the columns is not an option because I have given end users the feature of setting width, visibility and header text of columns in the schemas.

1 Reply

VS Vijayarasan Sivanandham Syncfusion Team March 6, 2020 02:17 PM UTC

Hi Bill,

Thank you for contacting Syncfusion support.

Your requirement can be achieved by the defining unbound column in SfDataGrid and give a value as increment of date in SfDataGrid.QueryUnboundColumnValue event. Please refer the below code snippet, 
 
this.sfDataGrid1.QueryUnboundColumnValue += SfDataGrid1_QueryUnboundColumnValue; 
 
private void SfDataGrid1_QueryUnboundColumnValue(object sender, GridUnboundColumnEventsArgs e) 
        {             
 
                var date = (e.Record as OrderInfo).Date; 
 
                e.Value = date.AddDays(2).ToString("MM/dd/yyyy");                 
             
        }      
  
 
Please find sample for the same from the link below,

Sample Link:
https://www.syncfusion.com/downloads/support/forum/152180/ze/Sample798696732

 
If we misunderstood your requirement, please provide more information regarding the requirement. This would help us to proceed further. 
Regards, 
Vijayarasan 


Loader.
Up arrow icon