RadMulticolumncomboBox in winforms

1 Answer 37 Views
MultiColumn ComboBox
Nandan
Top achievements
Rank 1
Iron
Iron
Nandan asked on 18 Jan 2022, 08:20 AM

Hi 

 

I am using radmulticolumncombobox.  when radmulticolumncombobox got focus that time it should be autodropdown automatically.  what should I do.   I have to use mouse to select the item Instead of that arrow key for navigation and enter key to select the item.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Jan 2022, 02:51 PM
Hello, Nandan, 

Please refer to the following code snippet demonstrating how to show the drop down with rows once RadMultiColumnComboBox gest the focus:
        private void radMultiColumnComboBox1_GotFocus(object sender, EventArgs e)
        {
            this.radMultiColumnComboBox1.MultiColumnComboBoxElement.ShowPopup();
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Nandan
Top achievements
Rank 1
Iron
Iron
commented on 19 Jan 2022, 03:16 PM

 

Hi Dess

Issue resolved.  Which event Radcombobox has like got focus or Lost focus.

When user press tab or enter key focus from Radcombobox  shift to another control say like multicolumncombox or radtextbox

 

Regards

Nandan

Dess | Tech Support Engineer, Principal
Telerik team
commented on 20 Jan 2022, 11:36 AM

Hello, Nandan,  

I would like to note that Telerik UI for WinForms suite offers RadDropDownList (released back in 2010), not a RadComboBox. Could you please specify what is the exact version that you are currently using since the RadComboBox control has not been available in the suite for e very long time?

RadDropDownList should be used instead. The following video also demonstrates how to switch from using RadComboBox to RadDropDownList:
https://www.telerik.com/videos/winforms/converting-from-radcombobox-to-raddropdownlist 
Nandan
Top achievements
Rank 1
Iron
Iron
commented on 21 Jan 2022, 08:31 AM

Hi Dess

Sorry to inform you  I am using RadDropDownList but call this dropdownlist as combobox.  I used to develop software in vb6 so I call dropdownlist as combobox.  I have not seen gotfocus or lostfocus event in RadDropDownList. so i use enter and leave event in RadDropDownList.

Regards

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 24 Jan 2022, 02:23 PM

Hello, Nandan,   

Similar to all RadControls, RadDropDownList also offers the GotFocus and LostFocus events. Please refer to the below code snippet demonstrating how to show the drop down when the control is focused after Tab key: 
        public RadForm1()
        {
            InitializeComponent();         

            this.radDropDownList1.GotFocus += RadDropDownList1_GotFocus;
            this.radDropDownList1.LostFocus += RadDropDownList1_LostFocus;
        }

        private void RadDropDownList1_LostFocus(object sender, EventArgs e)
        {
            Console.WriteLine("LoastFocus");
        }

        private void RadDropDownList1_GotFocus(object sender, EventArgs e)
        {
            this.radDropDownList1.ShowDropDown();
            Console.WriteLine();
        }
Nandan
Top achievements
Rank 1
Iron
Iron
commented on 26 Jan 2022, 08:17 AM

 

Hi Dess

 

Thank you very much.. When radMultiColumnComboBox1 fill up and i want to choose data which ever i want on up and down arrow. currently i am selecting by using mouse.

I giving sample code for this.

Private Sub mccmbStock_SelectedIndexChanged(sender As Object, e As EventArgs) Handles mccmbStock.SelectedIndexChanged
        Dim dtRowCount As DataTable = CType(mccmbStock.DataSource, DataTable)

        If dtRowCount.Rows.Count > 0 And cmbItemType.Text.Trim = "Bags" Then
            txtItemName.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemId").ToString()
            txtItemName.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemName").ToString()
            txtIssueWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("RecieveWt").ToString()
            txtIssuePr.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ReportPr").ToString()
            txtFineWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("FineWt").ToString()
            txtIssueWt.Focus()

end if

end sub

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 28 Jan 2022, 02:48 PM

Hello, Nandan,   

Once RadMultiColumnComboBox is opened, the up/down arrow keys moves the selection accordingly. Then, pressing Enter will confirm the selection and close the drop down: 

This is the default behavior. Are you experiencing any different behavior compared to the illustrated one? 

Nandan
Top achievements
Rank 1
Iron
Iron
commented on 29 Jan 2022, 07:22 AM

Hi Dess

Yes  up/down arrow keys moves the selection accordingly. Then, pressing Enter will confirm the selection and close the drop down. Same thing i want but not working i have to use mouse to select.

I will explain you briefly 

According to Bag type (Bag, Voucher) related RadMultiColumnComboBox fill accordingly if i choose 'MEB0001' respected value should enter in text boxes like finewt in txtfinewt.text like that. It work when i use mouse to select it. I want default behavior.

 here is my sample code

 Private Sub mccmbStock_SelectedIndexChanged(sender As Object, e As EventArgs) Handles mccmbStock.SelectedIndexChanged
        Dim dtRowCount As DataTable = CType(mccmbStock.DataSource, DataTable)

        If dtRowCount.Rows.Count > 0 And cmbItemType.Text.Trim = "Bags" Then
            txtFineWt.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("IssueId").ToString()
            txtItemName.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemId").ToString()
            txtItemName.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemName").ToString()
            txtRequired.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ReportPr").ToString()
            txtGrossWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("BalanceWt").ToString()
            txtGrossWt.Focus()
            txtGrossWt.SelectAll()
        ElseIf dtRowCount.Rows.Count > 0 And cmbItemType.Text.Trim = "Voucher" Then
            txtItemName.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemId").ToString()
            txtItemName.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemName").ToString()
            txtRequired.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ReceivePr").ToString()
            txtGrossWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("BalanceWt").ToString()
            txtFineWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("FineWt").ToString()
            txtFineWt.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("IssueId").ToString()
            txtGrossWt.Focus()
            txtGrossWt.SelectAll()
        ElseIf dtRowCount.Rows.Count > 0 And cmbItemType.Text.Trim = "Lot Add. Stock" Then
            txtFineWt.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("IssueId").ToString()
            txtItemName.Tag = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemId").ToString()
            txtItemName.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ItemName").ToString()
            txtRequired.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("ReceivePr").ToString()
            txtGrossWt.Text = CType(mccmbStock.DataSource, DataTable).Rows(mccmbStock.SelectedIndex).Item("BalanceWt").ToString()
            txtGrossWt.Focus()
            txtGrossWt.SelectAll()
        End If
    End Sub

 Private Sub mccmbStock_Enter(sender As Object, e As EventArgs) Handles mccmbStock.Enter

        If Not (String.IsNullOrEmpty(cmbItemType.Text)) Then
            If cmbItemType.SelectedIndex = 0 Then
                fillStockDetails("Bags")
            ElseIf cmbItemType.SelectedIndex = 1 Then
                fillStockDetails("Voucher")
            ElseIf cmbItemType.SelectedIndex = 2 Then
                fillStockDetails("Lot Add. Stock")
            End If

            mccmbStock.DropDownStyle = RadDropDownStyle.DropDownList
        End If
    End Sub

 

i am attaching screenshot for same

Dess | Tech Support Engineer, Principal
Telerik team
commented on 01 Feb 2022, 12:50 PM

Hello, Nandan,   

Note that if you click a row that is already selected/current in the popup grid, the SelectedIndexChanged event wouldn't be fired because in this case the selection remains the same. Hence, the respective data wouldn't be filled in the text boxes.

I would recommend you to handle the EditorControl.CellClick and detect which row is clicked. Then, extract the relevant information from the GridViewCellEventArgs.Row.Cells collection and populate the controls. 
        this.radMultiColumnComboBox1.EditorControl.CellClick += EditorControl_CellClick;

        private void EditorControl_CellClick(object sender, GridViewCellEventArgs e)
        {
            Console.WriteLine(e.Row.Cells["ProductName"].Value);
        }
I hope this information helps.
Tags
MultiColumn ComboBox
Asked by
Nandan
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or