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

Custom row maniupulation/generation

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?

3 Replies

AD Administrator Syncfusion Team May 26, 2005 05:09 PM UTC

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.


MC Martin Cyr May 31, 2005 02:11 PM UTC

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?


AD Administrator Syncfusion Team May 31, 2005 03:00 PM UTC

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;

Loader.
Up arrow icon