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.

Custom row maniupulation/generation

Thread ID:





29524 May 26,2005 12:20 PM May 31,2005 11:00 AM Windows Forms 3
Tags: GridControl
Martin Cyr
Asked On May 26, 2005 12:20 PM

I got a problem for wich I''m sure you guys at SyncFusion already tought of, but I have no idea what or where to search. I''d like to use a databound grid for wich I want to change rows colors (or anything really) according to a value contained in the datasource. Where should I start hacking? Paint? Or should I use a not databound grid and fill it manually?

Administrator [Syncfusion]
Replied On May 26, 2005 01:09 PM

Checkout this KB. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=84 It colors row 8, but instead you could check the test value on the row to decide to color things or not.

Martin Cyr
Replied On May 31, 2005 10:11 AM

If I understand correctly, I could color a precise cell/row/col at this moment, but I need something slightly more fancy. I need to choose the color according to a value in the corresponding DataRow/View, but the currency manager doesn''t seem to be synchronized. Still I could access the cell containing the color wich I wanna use, but obviously, this is a no-no since I don''t want to show this column to the user. Any ideas?

Administrator [Syncfusion]
Replied On May 31, 2005 11:00 AM

To get the DataRowView object in PrepareViewStyleInfo, you would get the CurrencyManager (or have a saved reference to the CurrencyManager) and look up the DataRowView through the CurrencyManager.List. Here is code you can use in PrepareViewStyleInfo to retrieve teh proper DataRowView assuming you have previously save a reference to the CurrencyManager in this.cm. int pos = this.grid.Binder.RowIndexToPosition(e.RowIndex); DataRowView drv = this.cm.List[pos] as DataRowView;


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.

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.