Behzad Behzad - 3 months ago 50
Vb.net Question

How to set Janus GridEX column index

I use Janus component in winForm application.

Now, I want to set column index of

GridEX
control, so I use below codes to do it:

grd.RootTable.Columns("ColumnName").Index = 1


or

grd.RootTable.Columns("ColumnName").ColumnSet = 1


but, both of them are readonly properties. Then I test below codes:

grd.RootTable.Columns("ColumnName").ColumnSetRow = 1


or

grd.RootTable.Columns("ColumnName").ColumnSetColumn = 1


but, an exception by below details occurred:


ColumnSerRow
or
ColumnSetColumn
property can only be set when the column belongs to a
ColumnSet



Please help me, how to change columns indexes in janus grid component?

Answer

You must use Position property in GridExColumn object. So your codes should be like this:

grd.RootTable.Columns("ColumnName").Position = 1

Now, The column which is name ColumnName moved to index 1