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

cell colour for vitual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

39430 Jan 6,2006 10:30 PM UTC Jan 9,2006 03:25 PM UTC WinForms 2
loading
Tags: GridControl
Hui Zhong
Asked On January 6, 2006 10:30 PM UTC

I want to colour the whole row of the current cell to some shellow yellow, current cell bright yellow, however to leave some uneditable cell on this row not coloured. I used some code as below: this.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow; protected override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e) { base.OnPrepareViewStyleInfo(e); if (e.RowIndex > this.Model.Rows.HeaderCount && e.ColIndex > this.Model.Cols.HeaderCount && this.CurrentCell.HasCurrentCellAt(e.RowIndex)) { e.Style.Interior = new BrushInfo(Color.Yellow); } } How to maintain the interior colour of some cell (not editable) in the same row? and how to set the current cell colour?

stanleyj [Syncfusion]
Replied On January 7, 2006 09:10 AM UTC

Hi Hui, By checking HasCurrentCellAt(e.RowIndex, e.ColIndex) and HasReadOnly other requirements are fulfilled. if (e.RowIndex > gridControl1.Model.Rows.HeaderCount && e.ColIndex > gridControl1.Model.Cols.HeaderCount ) if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex)) { e.Style.Interior = new BrushInfo(Color.LemonChiffon); } if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex)) { e.Style.Interior = new BrushInfo(Color.Yellow); } if( e.Style.HasReadOnly) { e.Style.Interior = new BrushInfo(Color.White); } Best regards, Stanley

Hui Zhong
Replied On January 9, 2006 03:25 PM UTC

Thanks. >Hi Hui, > >By checking HasCurrentCellAt(e.RowIndex, e.ColIndex) and HasReadOnly other requirements are fulfilled. > > > if (e.RowIndex > gridControl1.Model.Rows.HeaderCount && e.ColIndex > gridControl1.Model.Cols.HeaderCount ) > if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex)) > { > e.Style.Interior = new BrushInfo(Color.LemonChiffon); > } > if(this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex)) > { > e.Style.Interior = new BrushInfo(Color.Yellow); > } > if( e.Style.HasReadOnly) > { > e.Style.Interior = new BrushInfo(Color.White); > } > > >Best regards, >Stanley

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

;