Ticket S134808
Visible to All Users

GridListEditor - Make the CreateGridViewCore method return the GridView object

created 15 years ago

I need to make AdvBandedGridListEditor.
And now I can't override method GridListEditor.CreateGridViewCore() because AdvBandedGridView doesn't derive from XafGridView.
GridListEditor.CreateGridViewCore() used just method GridListEditor.CreateGridView() which returned GridView object.
Proposed Solution:
Change return type for method GridListEditor.CreateGridViewCore() to GridView

Show previous comments (1)
SZ SZ
Sergey Zaitsev (Xafari Team) 15 years ago

    I found post http://www.devexpress.com/Support/Center/p/Q92760.aspx with sample.
    May be it do for DX 7 or DX 9. But DX 10 has new synchronization model.
    And I think GridListEditor and BandedListEditor have more common features than differences.
    They have the same control. And GridListEditor differs from BandedListEditor just in the GridView type and cusmization form.
    P.S.
    BandedListEditor just a use case.
    I guess this is logical error: the same methods CreateGridViewCore and CreateGridView have different return type.

    Dennis Garavsky (DevExpress) 15 years ago

      Hi Sergey,
      Thanks for the feedback. We will review your suggestion again. Please bear with us.
      Thanks,
      Dennis

      Dennis Garavsky (DevExpress) 15 years ago

        Hello Sergey,
        We are afraid that this one change (or possibly a few changes in other places) won't greatly help you. There are a lot of dependencies on the GridView, GridColumn, etc. in the GridListEditor and standard controllers, using it.
        We won't currently refactor this code. As I already mentioned above, the best option for you is to implement your own ListEditor based on our sources or wait for the official implementation.
        Let me know if you need any further clarification on the subject.
        Thanks,
        Dennis

        Answers approved by DevExpress Support

        created 10 years ago (modified 8 years ago)

        We have implemented the functionality described in this ticket. It will be included in our next update(s).

        Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

        Additional information:

        We have changed the GridListEditor.CreateGridViewCore method return type to ColumnView. However, in your implementation, the returned type should support the IModelSynchronizersHolder interface. This interface is required to link column settings and the Application Model. Optionally, the IXafGridView, ISupportNewItemRow and ICustomiseFilterColumns interfaces can be supported. To see the example, refer to the XafGridView and XafBandedGridView source at c:\Program Files (x86)\DevExpress 1X.X\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Win\Editors\Grid\XafGridView.cs and c:\Program Files (x86)\DevExpress 1X.X\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Win\Editors\XafBandedGridView.cs respectively.

        You can create a custom GridListEditor descendant as shown below:

        C#
        using DevExpress.ExpressApp.Model; using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Win.Editors; namespace YourSolutionName.Module.Win { [ListEditor(typeof(object), true)] public class GridListEditorEx: GridListEditor { public GridListEditorEx(IModelListView model) : base(model) { } protected override DevExpress.XtraGrid.Views.Base.ColumnView CreateGridViewCore() { //return base.CreateGridViewCore(); return new YourGridViewType(); //YourGridViewType implementation must support the IModelSynchronizersHolder interface, which is required to link column settings and the Application Model. } } }
        Visual Basic
        Imports DevExpress.ExpressApp.Model Imports DevExpress.ExpressApp.Editors Imports DevExpress.ExpressApp.Win.Editors Namespace YourSolutionName.Module.Win <ListEditor(GetType(Object), True)> Public Class GridListEditorEx Inherits GridListEditor Public Sub New(ByVal model As IModelListView) MyBase.New(model) End Sub Protected Overrides Function CreateGridViewCore() As DevExpress.XtraGrid.Views.Base.ColumnView 'return base.CreateGridViewCore(); Return New YourGridViewType() 'YourGridViewType implementation must support the IModelSynchronizersHolder interface, which is required to link column settings and the Application Model. End Function End Class End Namespace

          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.