Question

I am new to DevExpress, I change my old DataGridView control for DevExpress GridControl. But my old codes gives error:

DataGridView1.Columns(12).Visible
DataGridView1.RowTemplate.Height
DataGridView1.Rows.Count

'Columns' is not a member of 'DevExpress.XtraGrid.GridControl'
'RowTemplate' is not a member of 'DevExpress.XtraGrid.GridControl'
'Rows' is not a member of 'DevExpress.XtraGrid.GridControl'

How to fix this problem?

Was it helpful?

Solution

At first, start from reading the XtraGrid documentation. Then use the DevExpress Support Center.

Anyway, here are some answers:

XtraGrid does not actually display data by itself. It uses Views to represent data. You can refer the View itself or refer to the GridControl's main View using the GridControl.MainView property.

DataGridView1.Columns(12).Visible

All columns are stored in the ColumnView.Columns collection. Use the GridColumn.Visible property to specify the column's visibility.

DataGridView1.RowTemplate.Height

You can set data row height manually using the View's GridView.RowHeight property

DataGridView1.Rows.Count

Use the GridView.RowCount property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top