Description:
Whenever a grid is loaded, the default column edit gets applied. For example, if I have a DateTime column field, the grid automatically applies a "DateEdit" repository item to that grid column. If I do not want that date editor, how can I clear it?
Answer:
Applies to:
XtraGrid, XtraTreeList, XtraVerticalGrid
The easiest solution to your problem is to create an editor of the desired type and assign it to the column's ColumnEdit property. In this case, the grid will use the editor you have assigned to the column.
There is also another solution. You can accomplish this in a GridControl derived class. You should inherit the DevExpress.XtraEditors.Repository.DefaultEditorsRepository class and override the GetRepositoryItem method. This method creates a RepositoryItemCheckEdit instance for Boolean columns and a RepositoryItemDateEdit for DateTime columns. You can create an editor of a different type or change the properties of the editors created by the grid. Then you will need to inherit the GridEditorContainerHelper and GridControl classes and override several of their methods to make the grid use an instance of your repository class instead of the DefaultEditorsRepository. This approach is utilized in the attached sample project.
See also:
How to create a GridView descendant class and register it for design-time use
How to inherit grid columns and use them in the XtraGrid
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.