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

Setting cell font based on data in different column in datatable

Thread ID:





14000 May 16,2004 06:55 PM UTC May 23,2004 08:24 PM UTC WinForms 4
Tags: GridControl
Patrick Noble
Asked On May 16, 2004 06:55 PM UTC

I am using a GridDataBoundGrid and I want to set the font in a cell conditional on the value of a column in the same row in the bound datatable. I know I need to handle PrepareViewStyleInfo to do this but how do I retrieve the datarow based on the GridPrepareViewStyleInfoEventArgs? VB.net please. Thanks.

Administrator [Syncfusion]
Replied On May 16, 2004 10:40 PM UTC

You can get the DataRowView from the CurrencyManager. Dim cm As CurrencyManager = CType(Me.BindingContext(Me.gridDataBoundGrid1.DataSource, Me.gridDataBoundGrid1.DataMember), CurrencyManager) Dim position As Integer = Me.gridDataBoundGrid1.Binder.RowIndexToPosition(e.RowIndex) Dim drv As DataRowView = cm.List(position) Here is a little sample. WindowsApplication2_7932.zip

Patrick Noble
Replied On May 21, 2004 07:02 PM UTC

That worked fine, then I discovered that when the splitter control is used, the font is changed on only one side of the splitter bar. How do I get it to be the same on both sides?

Administrator [Syncfusion]
Replied On May 21, 2004 07:18 PM UTC

If you are subscribing to events in a splitter/navigation control, then you have to subscribe to the event in the PaneCreated event and unsubscribe to them in the PaneClosing event. The reason is that as the splitter comes and goes, grids are created and destroyed. So, you havr to rewire the events for the new grids. Here is a KB on this problem. http://www.syncfusion.com/Support/article.aspx?id=580

Sue Harris
Replied On May 23, 2004 08:24 PM UTC

I also found that the ContextMenu property (if set) needs to be copied when creating the new grids.


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