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.
ADAdministrator Syncfusion Team 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.
PNPatrick NobleMay 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?
ADAdministrator Syncfusion Team 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.
SHSue HarrisMay 23, 2004 04:24 PM
I also found that the ContextMenu property (if set) needs to be copied when creating the new grids.