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.

Setting cell font based on data in different column in datatable

Thread ID:

Created:

Updated:

Platform:

Replies:

14000 May 16,2004 02:55 PM May 23,2004 04:24 PM Windows Forms 4
loading
Tags: GridControl
Patrick Noble
Asked On May 16, 2004 02:55 PM

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

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

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 03:18 PM

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

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

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.

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.

;