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.

GridControl in Virtual Mode and the Concept of GridModel...

Thread ID:

Created:

Updated:

Platform:

Replies:

122086 Feb 16,2016 07:11 AM Feb 17,2016 06:14 AM Windows Forms 1
loading
Tags: GridControl
bhushan
Asked On February 16, 2016 07:11 AM

Hi, 
    I am looking at a sample application of a GridControl being used to bind to a hierarchical data and in doing so, I am unable to understand how come without assigning anything to datasource (or GridModel in this case) the data is rendered in the Grid. The GridSaveCellInfo and GridQueryCellInfo have been implemented and there is a sub classing as well. There are various CellModels associated with the Model. However, I do not see any actual data being assigned to the model and it is being constructed polymorphically. So I need to understand how GridControl data assignment is done via a tutorial. Thanks. 

Amal Raj Umapathy Selvam [Syncfusion]
Replied On February 17, 2016 06:14 AM

Hi Bhushan,

Thank you for contacting Syncfusion support.

In our GridControl, we can have options to populate the grid by QueryCellStyleInfo event and by giving cellvalue to gridcell by its index.

1)By QueryCellStyleInfo event:
In QueryCellStyleInfo event, the grid is populated by giving cellvalue through style of a particular cell.

Code Snippet:
//Cellvalue is given through style of particular cell
e.Style.CellValue = e.RowIndex.ToString() + "/" + e.ColIndex.ToString();

Refer to the following sample in the mentioned location for further reference.
Sample Location: \Syncfusion\EssentialStudio\13.4.0.53\Windows\Grid.Windows\Samples\Virtual Grid\Virtual Grid Demo\CS

2)By Index of a cell:
We can set cellvalue to an individual cell of grid by using property CellValue.

Code Snippet:
//To set cell value to particular cell.

this.gridControl1[rowIndex, colIndex].CellValue = "Value";

Refer to the sample for further reference.
Sample Link: CellGrid-331959580

Regards,
Amal Raj U.

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.

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.

;