我需要将图像设置在网格的单元格内。我有一列是静态创建的,其他列是从数据库动态绑定的。在某些条件和动态值循环的情况下,我必须在静态列的行中设置图像。
//创建的静态列的代码
If UltraGridColumn.Tag Is Nothing And UltraGridColumn.Key = "TransactionStatus" Then
'Configure column
UltraGridColumn.CellActivation = If(Me.WorkflowsController.SelectedWorkflow.HasUpdateAccess, Activation.AllowEdit, Activation.ActivateOnly)
UltraGridColumn.CellAppearance.BackColor = Color.LightYellow
UltraGridColumn.CellAppearance.FontData.Bold = If(Me.WorkflowsController.SelectedWorkflow.HasUpdateAccess, DefaultableBoolean.True, DefaultableBoolean.False)
UltraGridColumn.CellAppearance.FontData.Italic = If(Not Me.WorkflowsController.SelectedWorkflow.HasUpdateAccess, DefaultableBoolean.True, DefaultableBoolean.False)
UltraGridColumn.ExcludeFromColumnChooser = ExcludeFromColumnChooser.True
UltraGridColumn.Header.Caption = "Transaction Status"
UltraGridColumn.Header.ToolTipText = "Transaction status."
UltraGridColumn.Hidden = False
UltraGridColumn.Style = ColumnStyle.DropDownList
UltraGridColumn.ValueList = Me.WorkflowsController.StatusesController.StatusesValueList
End If
//设置图片的代码
Dim transId = TransactionCommentsCollection.Select(Function(x) x.TransactionId)
Dim transLevelId = transId.Intersect(TransactionLevelCommentsCollection.Select(Function(x) x.TransactionId))
If (transLevelId.Contains(Record.TransactionId)) Then
//Get the corresponding cell here
'Set the cell image
UltraGridCell.Appearance.Image = My.Resources.Tran_comment_16
UltraGridCell.Appearance.ImageHAlign = HAlign.Right
UltraGridCell.Appearance.ImageVAlign = VAlign.Top
End If
如何获取静态创建的列的行和单元格并设置图像?