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
GridListEditor - Make the CreateGridViewCore method return the GridView object
Answers approved by DevExpress Support
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.
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 BasicImports 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
- v14.2.3Download Official Update
Hello Sergey,
Thanks for the feedback. It seems that it's better to create a fully custom ListEditor (based on the sources of the GridListEditor) and not to inherit from the GridListEditor class at all. This is because there are a lot of differences between these list editors.
For example, this suggestion contains links to some ready implementations: Support - provide an example, illustrating how to implement a custom ListEditor based on the AdvBandedGridView ( S19992 ).
What do you think?
Thanks,
Dennis
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.
Hi Sergey,
Thanks for the feedback. We will review your suggestion again. Please bear with us.
Thanks,
Dennis
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