Articles in this section
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.

Showing elements can be accessed through C++ code

Figure 1: Elements can be accessed through C++ code

Sample link:

C++: Control

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied