将自定义图像添加到网格单元格,该网格单元格是RepositoryItemButtonEdit devexpress按钮

时间:2015-06-19 15:46:37

标签: gridview devexpress

我正在尝试将自定义图像添加到网格单元格中,该网格单元格是RepositoryItemButtonEdit devexpress按钮。

当我执行以下代码时,我在按钮上看不到任何内容。

            Dim image As System.Drawing.Image =  System.Drawing.Image.FromFile("C:\carl\addAccount.png")

            Dim buttonAdd As New RepositoryItemButtonEdit           
            buttonAdd.TextEditStyle = TextEditStyles.HideTextEditor
            buttonAdd.Buttons(0).Kind = ButtonPredefines.Ellipsis
            buttonAdd.Buttons(0).Image = image

            AddHandler buttonAdd.Click, AddressOf Me.Button_Click


            Dim unbColumn As GridColumn = gvView.Columns.AddField("Button")
            unbColumn.VisibleIndex = gvgvView.Columns.Count
            unbColumn.ColumnEdit = buttonAdd

            gvView.OptionsView.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways

1 个答案:

答案 0 :(得分:0)

我猜你会看到省略号而不是你的图像。这是因为您将EditorButton.Kind属性设置为ButtonPredefines.Ellipsis。你需要它是雕文。查看ButtonPredefines Enumeration处的可能值。

>>> re.sub(r'[":]', '', s)
'1434919817660.wFzJl5KnFq1tyg5X0juKeQmbW8A='