This is a migrated thread and some comments may be shown as answers.

Custom GridView

6 Answers 119 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 15 Nov 2016, 12:23 PM

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

6 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 16 Nov 2016, 03:11 PM
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.
0
Christian
Top achievements
Rank 1
answered on 17 Nov 2016, 07:57 AM

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

 

0
Hristo
Telerik team
answered on 17 Nov 2016, 09:53 AM
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.
0
LT
Top achievements
Rank 1
answered on 03 Apr 2019, 09:04 PM

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

0
Hristo
Telerik team
answered on 04 Apr 2019, 06:56 AM
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 and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dimitar
Telerik team
answered on 08 Apr 2019, 04:11 PM
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.
Tags
MultiColumn ComboBox
Asked by
Christian
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Christian
Top achievements
Rank 1
LT
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or