DevExpress ,XtraGrid,GridControl,Gridview 使用点滴

1.在单元里显示日历控件、下拉框等

Imports DevExpress.XtraEditors.Repository



Dim irdata As New RepositoryItemCalcEdit



GridView1.Columns(1).ColumnEdit = irdata



2.格式化数字 ###,###.00

        GridView1.Columns(4).DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric  '此行必须要,不然下面的没有作用

        GridView1.Columns(4).DisplayFormat.FormatString = "¥{0:N2}"

3.获得某单元格的值

GridView1.GetRowCellValue(GridView1.FocusedRowHandle, GridView1.FocusedColumn)

4.用代码显示分组



         'GridView1.OptionsView.ShowGroupPanel = False'隐藏分组

        GridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "amount", GridView1.Columns("amount"), "小计:{0:N2}")    '可以显示小计



        GridView1.Columns("summary_id").GroupIndex = 2

        GridView1.ExpandAllGroups()  ' 初始就分组

'当然不能少了一句:

GridView1.OptionsView.ShowFooter = True

  

5.代码设置过滤条件

        GridView1.Columns("kmbm").FilterInfo = New ColumnFilterInfo(ColumnFilterType.Custom, Nothing, "[kmbm] like '%1001%' and [kmbm] like '%6%'")

'此处列名为kmbm , 区分大小写.



6.弹出菜单



 PopupMenu1.ShowPopup(Control.MousePosition)



你可能感兴趣的:(DevExpress)