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

Update of GridModel in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

145566 Jun 28,2019 05:52 AM UTC Jun 28,2019 12:46 PM UTC WinForms 1
loading
Tags: GridControl
WillieBoykin
Asked On June 28, 2019 05:52 AM UTC

Hi, 

I have a grid with a row containing columns with covered cells (3 per column). So I wanted to write a custom copy paste for the same. Now the problem which I am facing is that my grid has a base class as UiBaseGrid where GridControl is getting created by passing a object of the class UiGridModel derived from GridModel. In the UiGridModel clipboardCopy and clipboardPaste functions are overridden and thus evertime I do Copy/Paste operation on my grid the control goes there.

Now in my class I wanted to override that grid model set in the GridControl with my own GridModel class. Can anyone please tell me if it is possible to do so. 


Regards

Subburaj Pandian Veluchamy [Syncfusion]
Replied On June 28, 2019 12:46 PM UTC

Hi WillieBoykin, 
  
Thank you for contacting Syncfusion support. 
  
We have analyzed the mentioned scenario and suspect that base grid model is not initialized with the your UiGridModel is while initializing your custom UiGridControl. In order to update the grid model, we suggest you to initialize the base while the grid is initialized.  
 
Please refer to the below code, 
   
 
public class CustomGridControl : GridControl 
{ 
    public CustomGridControl(CustomGridModel model) 
        base(model// To override base grid model with the customized grid model. 
    { 
  
    } 
} 
  
public class CustomGridModel : GridModel 
{ 
    public CustomGridModel () 
        base() 
    { 
  
    } 
} 
  
If still the issue exists, please provide us with simple sample with your customization. 
 
Regards,
Subburaj Pandian V     


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