Articles in this section
Category / Section

How to use GridControl in C++ with Visual Studio?

All the elements of GridControl can be accessed through C++ code in the Windows Forms application.


The following code explains how to use the control using C++ code.

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

 

Conclusion

I hope you enjoyed learning how to use GridControl in C++ with Visual Studio.


You can refer to our WinForms GridControl feature tour page to know about its other groundbreaking feature representations and WinForms GridControl documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms GridControl example to understand how to create and manipulate data.

 

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.


If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

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