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

How to change Style and data of one cell...without using a event

Thread ID:





96566 Sep 20,2010 08:22 PM UTC Sep 24,2010 05:36 AM UTC WinForms 1
Tags: GridControl
David Mecteaux
Asked On September 20, 2010 08:22 PM UTC


Could someone show me how to change the data in a cell and its style programmatically. I don't want to do this within a event (no QueryCellStyleInfo). I want to do it somewhat like:

gridGroupingControl1.blah.blah.Style.ReadOnly = true;
gridGroupingControl.blah.blah.CellValue = "Hello"



Jisha Joy [Syncfusion]
Replied On September 24, 2010 05:36 AM UTC

Hi Dave,

Thank you for using Syncfusion products.

In a GridGroupingControl, QueryCellStyleInfo event or TableControlPrepareViewStyleInfo event should be used to set cell styles. In a GridGroupingControl, we cannot use indexers to set style properties (other than the Text) for individual cells. The reason is that in a GridGrouping Control, there are no individual cell styles stored. See the following sample in which required behavior is implemented by using the QueryCellStyleInfo event:


If you want to apply row styles depending on the cellvalues, you could use GridConditionalFormatDescriptor. See the following sample from the sample browser:

..\Windows\Grid.Grouping.Windows\Samples\2.0\Appearance\Conditional Formatting Demo

Please let me know if you have any questions.



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