Category / Section
How to use GridControl in C++ with Visual Studio?
1 min read
All the elements of GridControl can be accessed through C++ code in the WindowsForms application.
The following code explains how to use the control using C++ code.
C++
void OnQueryCellInfo(System::Object ^sender, Syncfusion::Windows::Forms::Grid::GridQueryCellInfoEventArgs ^e); void Control::Form1::OnQueryCellInfo(System::Object ^sender, Syncfusion::Windows::Forms::Grid::GridQueryCellInfoEventArgs ^e) { if (e->ColIndex == 2 && e->RowIndex > 0) { e->Style->Text = " Setting Color 1"; e->Style->BackColor = Color::LightSkyBlue; e->Style->TextColor = Color::Red; } }
After applying the properties, the grid is displayed as follows.
Figure 1: Elements can be accessed through C++ code
Sample link:
C++: Control