Is update of GridModel in a GridControl possible

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
PA

6 Replies

AD Administrator Syncfusion Team October 16, 2006 01:36 PM UTC

Hi PA,

I am looking into this and will update you the details soon.

Sorry for the inconvenience caused.

Regards,
Haneef


AD Administrator Syncfusion Team October 17, 2006 01:32 PM UTC

Hi PA,

The GridModel can be attached and replaced with another object at run-time. The GridControl class will remove any dependencies on the old model and set up a relationship with the new model.

When you replace the model, the grid control will completely refresh and draw the new cell data. Here is a code snippet to attach the new CustomCellModel in a Grid.

MyGridModel model = new MyGridModel();

model.BeginInit();
model.RowCount = 3;
model.ColCount = 3;

//You should set the Cols/Rows.DefaultSize property to show the grid.
model.Cols.DefaultSize = 65;
model.Rows.DefaultSize = 17;

model.EndInit();

this.Mygrid.Attach(model);

Let me know if this works.

Best Regards,
Haneef


AD Administrator Syncfusion Team October 17, 2006 02:01 PM UTC

Hi Pa,

The Attached sample shows how you can register the Custom GriModel in a grid. It also implements the Covered cell pasting in a grid. Please try the attached sample and let me know if you are looking something different.

http://www.syncfusion.com/Support/user/uploads/PastewithModel_7e5a8231.zip

Best Regards,
Haneef


PR Prashant October 18, 2006 11:01 AM UTC

Hi Haneef,

Thanks for the reponse, I did able to replace the Grid model. But I am facing a peculiar problem that all the bitmaps which I am associating with the gridstyleinfo are not getting displayed after replacing the model. If I donot replace the model than everything appears as intended.

Do you know if there is anything which I might be missing. Let me know if you need the code snippet for analyzing the problem.

Thanks and Regards
Prashant Agarwal
>Hi Pa,

The Attached sample shows how you can register the Custom GriModel in a grid. It also implements the Covered cell pasting in a grid. Please try the attached sample and let me know if you are looking something different.

http://www.syncfusion.com/Support/user/uploads/PastewithModel_7e5a8231.zip

Best Regards,
Haneef


MG mgkyaing replied to Administrator March 30, 2018 08:44 AM UTC

Hi PA,

I am looking into this and will update you the details soon.

Sorry for the inconvenience caused.

Regards,
Haneef

Hello,
I am looking for the best  java programming ebook.

Thanks.


TW Tres Watkins Syncfusion Team April 3, 2018 02:19 PM UTC

Hi, 
You might enjoy Java Succinctly by Christopher Rose: 
Sincerely, 
Tres Watkins 
Content Development Manager, Syncfusion, Inc. 


Loader.
Up arrow icon