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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refreshing Row/Column styles

Thread ID:

Created:

Updated:

Platform:

Replies:

4327 May 7,2003 10:01 PM May 13,2003 08:33 PM Windows Forms 6
loading
Tags: GridControl
Sue Harris
Asked On May 7, 2003 10:01 PM

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 02:58 AM

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 02:50 PM

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 04:16 PM

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;
	this.gridControl1.Refresh();
}

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 04:44 PM

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 05:06 PM

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 1.6.0.1 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 1.6.0.1 beta, you can submit a Direct Trac support incident and I can send you a download link. Clay

Sue Harris
Replied On May 13, 2003 08:33 PM

Thanks Clay, The 1.6 beta works perfectly.

CONFIRMATION

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.

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

;