KB Article K18372
Visible to All Users

Can the GridControl be used completely in unbound mode?

Description:
I don't want to bind the GridControl to any datasource. Can the GridControl be used completely in unbound mode? I want be able to populate its cells at design time. Is it possible?

Answer:
As stated in the documentation (Binding to Data), the XtraGrid can't be used in unbound mode. However, it's not a problem.
Simply bind the GridControl to any datasource that supports the IList interface and work with the GridControl, as if it's in unbound mode. You can add, delete, and edit data using only the GridView's methods (Adding and Deleting Records). Please review the GridUnboundModeViaCollection tutorial project which can be found in Windows Start Menu. It demonstrates the simplest solution for data binding. We also advise that you look at the Data Binding Overview topic in the XtraGrid help.
The XtraTreeList may suit your task better. It supports unbound mode, i.e. you can add rows (nodes) directly to the TreeList and set cell values.
If it's necessary for you to populate the data at design time, you can create a custom design-time data editor. Attached is an example demonstrating this solution.

Comments (2)

    I was a VCL Product customer before. Now i transferred to another job. I'm newer for your .net product and still evaluate your .net product. For VCL Grid product, It can support fully unbound mode, Why .net product cannot support it? We really need it because it can give the developer more flexibility as they want than the bound mode. The developers really need it. We appreciate you can made plan to support the fully unbound mode. Thanks, guys.

    DevExpress Support Team 13 years ago

      Our XtraGrid does not work in the Unbound Mode and we do not plan to introduce it in the near future because it will be necessary to completely override this control. Our TreeList control supports the Unbound Mode. You can use it to achieve your goal.

      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.