2

グリッドのセル内に画像を設定する必要があります。静的に作成された列があり、他の列はデータベースから動的にバインドされています。特定の条件と動的値のループにより、静的列の行に画像を設定する必要があります。

//作成された静的列のコード

 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

静的に作成された列の行とセルを取得し、画像を設定するにはどうすればよいですか?

4

1 に答える 1