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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refreshing Row/Column styles

Thread ID:





4327 May 8,2003 02:01 AM UTC May 14,2003 12:33 AM UTC WinForms 6
Tags: GridControl
Sue Harris
Asked On May 8, 2003 02:01 AM UTC

Hi, Is it possible to force a refresh (requery) of a row/column styles for a virtual grid without calling ResetVolitileData? For example, I'm updating my internal data for a column's style, I call InvalidateRange on a Column Range for that column, but only individual cell QueryCellInfo calls are made, not for the column. (I want a QueryCellInfo event with e.ColIndex = mycolumn and e.RowIndex = -1). Thanks, Sue

Administrator [Syncfusion]
Replied On May 8, 2003 06:58 AM UTC

As a matter of fact, you can provide the column styles dynamically in QueryCellInfo by checking for e.RowIndex == -1.
//set column style 2
if(e.ColIndex == 2 && e.RowIndex == -1)
	e.Style.BackColor = Color.LightGoldenrodYellow;
Is it not working for you?

Sue Harris
Replied On May 8, 2003 06:50 PM UTC

Thats right, I'm providing all my styles dynamically via the QueryCellInfo. I initially set a style to something (for example LightGoldenrodYellow color) and then when the user does something else (clicks a button for example) I want to change that style, but I can't get the QueryCellInfo to refire with the -1 row index.

Administrator [Syncfusion]
Replied On May 8, 2003 08:16 PM UTC

Calling grid,Refresh() seemed to work for me in these code snippets.
Color c = Color.LightGoldenrodYellow;

private void button1_Click(object sender, System.EventArgs e)
	c = Color.LightBlue;

private void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
	if(e.RowIndex == -1  && e.ColIndex == 1)
		e.Style.BackColor = c;

Sue Harris
Replied On May 8, 2003 08:44 PM UTC

Clay, That is exactly what I want to happen but its not happening for me. I've attached a simple sample, which started as your virtual grid sample. I added a checkbox and in the CheckChanged event I call grid.Refresh. But I'm not getting a QueryCellInfo call with a -1 row count. Please tell whats going wrong. Thanks Sue

Administrator [Syncfusion]
Replied On May 8, 2003 09:06 PM UTC

Sue, Your code works for me. Now I am running 1.0 FrameWork so I had to change the proj and sln files a little to get things to run. I am also using teh beta code. But I see the text color change from green to pink and back again as I click the button. What version are you using? If you want to try the beta, you can submit a Direct Trac support incident and I can send you a download link. Clay

Sue Harris
Replied On May 14, 2003 12:33 AM UTC

Thanks Clay, The 1.6 beta works perfectly.


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

Live Chat Icon For mobile
Live Chat Icon