Objective Grid: Changing the data of a grid without a view

Article ID: 83
Last updated: 22 Jun, 2018
Article ID: 83
Last updated: 22 Jun, 2018
Revision: 3
Views: 1741
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 22 Jun, 2018
by Meltreger B.

Problem


How can I change the grid data from the document when no grid view is attached to it?


Cause



Action


We recommend changing all data by using the command methods provided by CGXGridView (SetStyleRange, RemoveRows, ....).

Sometimes there are situations where you want to modify the data directly. Then you can call the CGXData methods: StoreStyleRowCol(), StoreRemoveRows(), etc. directly. Take a look at the CGXData reference for more information.

If you want to initialize the CGXData object from within your document before a view is attached to the document, do the following steps.

On creation of a document:

Create a 'new CGXGridParam' object in the document's constructor
Create a 'new CGXData' object and attach it to the parameter object by calling SetData(new CGXData).

When a new document is created, you can directly assign data to the data-object (CGXData has StoreStyleRowCol() method).

When a document is opened, you can serialize the data-object from the document through its Serialize()method.

On the creation of a view:

Set the grid specific options like the number of header rows, etc.
Set the captions, dropdown lists, and styles for all the cells

The grid will automatically load and store data in the CGXData object you attached to CGXGridParam.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 83
Last updated: 22 Jun, 2018
Revision: 3
Views: 1741
Posted: 23 Jan, 2001 by Meltreger B.
Updated: 22 Jun, 2018 by Meltreger B.

Others in this category