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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





122086 Feb 16,2016 12:11 PM UTC Feb 17,2016 11:14 AM UTC WinForms 1
Tags: GridControl
Asked On February 16, 2016 12:11 PM UTC

    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 11:14 AM UTC

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\\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

Amal Raj U.


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