문제

I try to get the ColumnNames and the current Vieworder of my GridControl. The docu won't help me an the ".Net Reflector"-Tool also won't give me advice.

The tip from an other stackoverflowpost ( How to hide column of devexpress XtraGrid ) also won't help me, because, i can't access View.Columns

도움이 되었습니까?

해결책

I suggest you are trying to use property gridControl.MainView to access a view. This property is of type BaseView (base class for all views) so in order to access columns/order information you should cast it to GridView (or whatever type you are using):

var firstColumnName = ((GridView)gridControl.MainView).Columns[0].FieldName;

다른 팁

If you haven't populated the column collection , there will be no column to access.

This is something that you'll usually do while you are designing the grid.

Run designer -> Columns -> Retrieve Fields.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top