Custom GridView

7 posts, 0 answers
  1. Christian
    Christian avatar
    44 posts
    Member since:
    May 2012

    Posted 15 Nov 2016 Link to this post

    Hello,

    is there any easy way to use a custom RadGridView as grid element of the MultiColumnComboBox?

    Or do I need to override the hole object chain?

    in RadMultiColumnComboBox.cs

    protected virtual RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()

    in RadMultiColumnComboBoxElement.cs

    public MultiColumnComboPopupForm MultiColumnPopupForm // not virtual?!

    in MultiColumnComboPopupForm.cs

    protected virtual void InitializeEditorElement()

    in GridViewHostItem.cs

    public GridViewHostItem() : base(new MultiColumnComboGridView())
    public MultiColumnComboGridView HostedGridView // not virtual?!

    ...

     

    Are there any examples?

     

    Kind regards,

    Christian

  2. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 16 Nov 2016 Link to this post

    Hello Christian,

    Thank you for writing.

    Currently, that is not possible without actually changing the source code. I logged a request on our feedback portal and I have also voted for it on your behalf. The item is located here: IMPROVE. RadMultiColumnComboBox - expose an API for using a custom RadGridView control in the popup form. Additionally, you can subscribe to it and be updated with all of its status changes. You Telerik points are also updated accordingly.

    Can you please let me know what kind of custom behavior you would like to use with the custom grid control so that I can help you in achieving it?

    I hope this helps. Looking forward to your reply.

    Regards,
    Hristo Merdjanov
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
  3. Christian
    Christian avatar
    44 posts
    Member since:
    May 2012

    Posted 17 Nov 2016 in reply to Hristo Link to this post

    Hello Hristo,

    thank you for putting this to the feedback portal.

    The case was that I've a custom grid with amongst other things there are a lot of helper methods which I wanted to use with the MultiColumnComboBox Grid. I've rewrote some of them now as extension methods. But there are other custom features which I'd like to use in the future. 

    Kind regards,

    Christian

     

  4. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 17 Nov 2016 Link to this post

    Hello Christian,

    Thank you for writing back.

    I am glad that you have managed to find a suitable solution for now. In case you need to also use some of the custom features of your control please let us know. You can open a ticket and attach your project there.

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo Merdjanov
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
  5. LT
    LT avatar
    6 posts
    Member since:
    Oct 2018

    Posted 03 Apr Link to this post

    Hello,

    Has there been some update this to override the editor control for the multicolumncombobox? I am using virtual mode to optimize searches, but I need to be able to filter and sort across multiple columns while still using autocompletemode.

    Thank you,

    LT

  6. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 04 Apr Link to this post

    Hi LT,

    Still, the item is not yet completed so I added a vote for it on your behalf. We will do our best to address the request in the R2 2019 release, scheduled for the beginning of May. Once the item is fully tested it will be merged in our branch with internal builds and the compiled assemblies can be downloaded and tested even before the official R2 version.
    Let me know if you need further assistance.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  7. Dimitar
    Admin
    Dimitar avatar
    3 posts

    Posted 08 Apr Link to this post

    Hello, 
     
    A fix will be available in LIB Version 2019.1.415 scheduled for April 15th. Exposing an API for using a custom RadGridView control in the popup form.

    When fix is released you will be able to use custom RadGridView as grid element of the MultiColumnComboBox as follows: 
    using System;
    using Telerik.WinControls;
    using Telerik.WinControls.UI;
     
    namespace MCCBCustomRadGridView
    {
        public partial class RadFormCustomGrid : Telerik.WinControls.UI.RadForm
        {
            public RadFormCustomGrid()
            {
                InitializeComponent();
            }
     
            private void RadFormCustomGrid_Load(object sender, EventArgs e)
            {
                this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
            }
        }
     
        public class MyRadMultiColumnComboBox : RadMultiColumnComboBox
        {
            public override string ThemeClassName
            {
                get
                {
                    return typeof(RadMultiColumnComboBox).FullName;
                }
            }
     
            protected override RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()
            {
                return new MyRadMultiColumnComboBoxElement();
            }
        }
     
        public class MyRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement
        {
            protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(RadMultiColumnComboBoxElement);
                }
            }
     
            protected override RadPopupControlBase CreatePopupForm()
            {
                MultiColumnComboPopupForm popupForm = new MyMultiColumnComboPopupForm(this);
                popupForm.EditorControl.Focusable = false;
                popupForm.MinimumSize = this.DropDownMaxSize;
                popupForm.MaximumSize = this.DropDownMaxSize;
                popupForm.Height = this.DropDownHeight;
                popupForm.VerticalAlignmentCorrectionMode = AlignmentCorrectionMode.SnapToOuterEdges;
                popupForm.HorizontalAlignmentCorrectionMode = AlignmentCorrectionMode.Smooth;
                popupForm.RightToLeft = this.RightToLeft ? System.Windows.Forms.RightToLeft.Yes : System.Windows.Forms.RightToLeft.Inherit;
                this.WirePopupFormEvents(popupForm);
     
                return popupForm;
            }
        }
     
        public class MyMultiColumnComboPopupForm : MultiColumnComboPopupForm
        {
            internal bool closed;
     
            public MyMultiColumnComboPopupForm(RadMultiColumnComboBoxElement element)
                : base(element)
            { }
     
            protected override GridViewHostItem CreateEditorElement()
            {
                return new MyGridViewHostItem();
            }
     
     
            /// <summary>
            /// Fires when the popup is opened.
            /// </summary>
            protected override void OnPopupOpened()
            {
                base.OnPopupOpened();
                closed = false;
            }
     
            /// <summary>
            /// Fires when the popup is closed.
            /// </summary>
            /// <param name="args">A RadPopupClosedEventArgs instance
            /// that contains information about what caused the popup to close.</param>
            protected override void OnPopupClosed(RadPopupClosedEventArgs args)
            {
                base.OnPopupClosed(args);
                closed = true;
            }
        }
     
        public class MyGridViewHostItem : GridViewHostItem
        {
            public MyGridViewHostItem()
                : base(new MyRadGridView())
            { }
        }
     
        public class MyRadGridView : RadGridView
        {
            #region Ctor
     
            public MyRadGridView()
            {
                this.GridBehavior = new MultiColumnComboGridBehavior();
            }
     
            protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
            {
                MyMultiColumnComboPopupForm form = this.Parent as MyMultiColumnComboPopupForm;
                if (form != null && form.closed)
                {
                    return;
                }
     
                base.OnMouseDown(e);
            }
            #endregion
     
            #region Methods
     
            protected override bool ProcessFocusRequested(RadElement element)
            {
                return false;
            }
     
            public override string ThemeClassName
            {
                get
                {
                    return "Telerik.WinControls.UI.RadGridView";
                }
                set
                {
                    base.ThemeClassName = value;
                }
            }
     
            #endregion
        }
    }

    You can also see the code inside the attached project.

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top