GridViewMultiComboBoxColumn dropdown closed

33 posts, 0 answers
  1. james
    james avatar
    4 posts
    Member since:
    Sep 2016

    Posted 27 Sep 2016 Link to this post

    Dear all 

    I have a question 

    how do all this syntax in GVMCCB ? 

        Private Sub CMMBCustomer_CustomFiltering(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCustomFilteringEventArgs)

            Dim element As RadMultiColumnComboBoxElement = MCCBCustomer.MultiColumnComboBoxElement

            Dim textToSearch As String = MCCBCustomer.Text
            If AutoCompleteMode.Append = (element.AutoCompleteMode And AutoCompleteMode.Append) Then
                If element.SelectionLength > 0 AndAlso element.SelectionStart > 0 Then
                    textToSearch = MCCBCustomer.Text.Substring(0, element.SelectionStart)
                End If
            End If

            If String.IsNullOrEmpty(textToSearch) Then
                e.Visible = True

                For i As Integer = 0 To element.EditorControl.ColumnCount - 1
                    e.Row.Cells(i).Style.Reset()

                Next

                e.Row.InvalidateRow()
                Return
            End If

            e.Visible = False
            For i As Integer = 0 To element.EditorControl.ColumnCount - 1
                Dim text As String = e.Row.Cells(i).Value.ToString()
                If text.IndexOf(textToSearch, 0, StringComparison.InvariantCultureIgnoreCase) >= 0 Then
                    e.Visible = True
                    e.Row.Cells(i).Style.CustomizeFill = True
                    e.Row.Cells(i).Style.DrawFill = True
                    e.Row.Cells(i).Style.BackColor = Color.FromArgb(201, 252, 254)
                Else
                    e.Row.Cells(i).Style.Reset()

                End If
            Next
            e.Row.InvalidateRow()
        End Sub
        Private Sub CMMBCustomer_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
            With MCCBCustomer
                If e.KeyCode = System.Windows.Forms.Keys.Enter Then
                    If .ValueMember <> "" Then
                        .SelectedValue = .EditorControl.CurrentRow.Cells(.ValueMember).Value
                    Else
                        .SelectedValue = .EditorControl.CurrentRow.Cells(.DisplayMember).Value
                    End If

                    .Text = .EditorControl.CurrentRow.Cells(.DisplayMember).Value.ToString()
                    .MultiColumnComboBoxElement.ClosePopup()
                    .MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.SelectAll()
                End If
            End With
        End Sub

     

        Private Sub CMMBCustomer_DropDownClosed(ByVal sender As Object, ByVal args As Telerik.WinControls.UI.RadPopupClosedEventArgs) Handles MCCBCustomer.DropDownClosed
            If MCCBCustomer.SelectedIndex <> -1 Then
                LblNamaCustomer.Text = MCCBCustomer.EditorControl.Rows(MCCBCustomer.SelectedIndex).Cells(1).Value.ToString
            Else
                LblNamaCustomer.Text = ""
            End If
        End Sub

     

        Private Sub CMMBCustomer_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MCCBCustomer.Validated
            If MCCBCustomer.Text = "" Then
                LblNamaCustomer.Text = ""
            End If
        End Sub

     

    Thanks before... 

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 27 Sep 2016 Link to this post

    Hello James,

    Thank you for writing.  

    Note that you can handle the RadGridView.CellEditorInitialized event which is fired once the editor is initialized. This is the place where you have access to the RadMultiColumnComboBoxElement and you can subscribe to any of the desired events that you want to use:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products)
        Me.CategoriesTableAdapter.Fill(Me.NwindDataSet.Categories)
     
        Me.RadGridView1.DataSource = ProductsBindingSource
     
        Dim col As GridViewMultiComboBoxColumn = New GridViewMultiComboBoxColumn("Category")
        col.DataSource = Me.CategoriesBindingSource
        col.DisplayMember = "CategoryName"
        col.ValueMember = "CategoryID"
        col.FieldName = "CategoryID"
        Me.RadGridView1.Columns.Add(col)
     
        AddHandler Me.RadGridView1.CellEditorInitialized, AddressOf CellEditorInitialized
    End Sub
     
    Private Sub CellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
        Dim mccb As RadMultiColumnComboBoxElement = TryCast(e.ActiveEditor, RadMultiColumnComboBoxElement)
        If mccb IsNot Nothing Then
            RemoveHandler  mccb.KeyDown, AddressOf mccb_KeyDown
            AddHandler mccb.KeyDown, AddressOf mccb_KeyDown
        End If
     
    End Sub
     
    Private Sub mccb_KeyDown(sender As Object, e As KeyEventArgs)
        Console.WriteLine(e.KeyData)
    End Sub

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    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. james
    james avatar
    4 posts
    Member since:
    Sep 2016

    Posted 27 Sep 2016 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello Dess 

    Thanks for fast respone... i will try it first ...

    thanks You very much

     

  4. james
    james avatar
    4 posts
    Member since:
    Sep 2016

    Posted 27 Sep 2016 in reply to james Link to this post

    Hello Dess 

    i need to fill the field "NAMA" inside the gridview from mccb.dropdown how make this happen ? 

    i need to filtering too when user type in mccb gridview 

    Thanks before

     

    Note : please give me the very simple code... 

  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 29 Sep 2016 Link to this post

    Hello James, 

    Thank you for writing back. 

    In order to populate the RadMultiColumnComboBoxElement in the GridViewMultiComboBoxColumn with data, you can set the GridViewMultiComboBoxColumn.DataSource property to the desired collection. Additional information how to setup the columns is available here: http://docs.telerik.com/devtools/winforms/gridview/columns/column-types/gridviewmulticomboboxcolumn

    After making a selection in the editor, you can set the value for another cell on the same row. Here is a sample code snippet which result is illustrated in the attached gif file: 
    Me.RadGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill

    Private Sub ValueChanged(sender As Object, e As EventArgs)
        Dim mccb As RadMultiColumnComboBoxElement = TryCast(Me.RadGridView1.ActiveEditor, RadMultiColumnComboBoxElement)
        If mccb IsNot Nothing Then
            Dim rowInfo As GridViewDataRowInfo = TryCast(mccb.SelectedItem, GridViewDataRowInfo)
            Me.RadGridView1.CurrentRow.Cells("CategoryID").Value = rowInfo.Cells("CategoryID").Value
        End If
    End Sub

    As to the filtering functionality, you can refer to the following example. Thus, when typing in the editor, the popup grid is filtered: 
    AddHandler Me.RadGridView1.CellEditorInitialized, AddressOf CellEditorInitialized

    Private Sub CellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
        Dim mccb As RadMultiColumnComboBoxElement = TryCast(e.ActiveEditor, RadMultiColumnComboBoxElement)
        If mccb IsNot Nothing Then
            mccb.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
            mccb.AutoFilter = True
            If mccb.EditorControl.FilterDescriptors.Count = 0 Then
                Dim filter As New FilterDescriptor()
                filter.PropertyName = mccb.DisplayMember
                filter.Operator = FilterOperator.Contains
                mccb.EditorControl.MasterTemplate.FilterDescriptors.Add(filter)
            End If
        End If
    End Sub

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    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.
  6. james
    james avatar
    4 posts
    Member since:
    Sep 2016

    Posted 04 Oct 2016 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Halllo dess Many thanks to you it's work fine...

    Thanks..

  7. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 03 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello dess... ?

    i've tried the code you wrote why it doesn't work for me ? 

    Private Sub ValueChanged(sender As Object, e As EventArgs)
        Dim mccb As RadMultiColumnComboBoxElement = TryCast(Me.RadGridView1.ActiveEditor, RadMultiColumnComboBoxElement)
        If mccb IsNot Nothing Then
            Dim rowInfo As GridViewDataRowInfo = TryCast(mccb.SelectedItem, GridViewDataRowInfo)
            Me.RadGridView1.CurrentRow.Cells("CategoryID").Value = rowInfo.Cells("CategoryID").Value
        End If
    End Sub

     

    how to call this sub ? 

     

    Thanks before

  8. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 03 Jan 2018 Link to this post

    Hai Dess 

    or how access dropdownclosed in gridviewmulticolumncombobox....

    "Me.RadGridView1.CurrentRow.Cells("CategoryID").Value = rowInfo.Cells("CategoryID").Value" i need this code run when dropdwonclosed

    Thanks

     

  9. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 04 Jan 2018 Link to this post

    Hello, Hengky, 

    Thank you for writing.  

    The ValueChanged event in RadGridView is fired when you change the value in the editor. RadMultiColumnComboBoxElement automatically closed its popup when a row is selected in the inner grid. Then, the ValueChanged event will be fired and the value of the neighboring cell will be updated accordingly.

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  10. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 05 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai Dess 

    Can i have the code for changevalue.gif ? 

    Because i have tried wrote snippet code you give to james, and it doesn't work.on me .. 

    Thanks before.

  11. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 05 Jan 2018 in reply to Hengky Link to this post

    I mean full coding not a snippet code... 

    :D

     

    Tq before dess

  12. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 05 Jan 2018 Link to this post

    Hello, Hengky, 

    Thank you for writing back. 

    I have attached a sample project for your reference.

    I would kindly ask you to use our support ticketing system for any further inquiries that you have. Thus, all your threads will be handled by our support staff according to license and time of posting.

    Thank you for your understanding.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  13. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 08 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Tq dess for writing back and for the solution 

    but i need the categoriID selected or can be change through gridmccb. not categori name.

    one more, why its very slow ? when fill data to gridmccb.

    Thanks dess

    Best Regards

    Hengky

  14. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 08 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai Dess thanks for writing back 

    how if i need to change the category id, not the category name.

    your example is change the categoryname, what i need is change the CategoryId on Product table

     

    thanks before 

    * i will mentioned about licensing.

  15. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 08 Jan 2018 Link to this post

    Hello, Hengky, 

    Thank you for writing back. 

    It is up to you for which field you will add the GridViewMultiComboBoxColumn. It is necessary to specify the column's FieldName property (e.g. "CategoryID") and populate it with data (by the DataSource property). Then, in the RadGridView.ValueChanged event you can manipulate each cell value according to your custom requirement.  

    I hope this information helps. If you have any additional questions, please let me know. 

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  16. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 08 Jan 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello Dess,

    thanks for the solution and now it works,

    but i have problem... like the attachment pic.

    it's error when i hit enter on column 3,4 

    column 5 is expression on column 3 and 4

     

    Thanks

  17. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 09 Jan 2018 Link to this post

    Hello, Hengky, 

    Thank you for writing back. 

    I was not able to replicate the issue with my sample project. However, according to the error message, I suppose that you have only constructors with parameters in your custom object. In this case, the parameterless constructor is required by our implementation in RadGridView to create a new instance of the class and populate the data according to the data in the columns. So in order to be able to add new rows you need to add a parameterless constructor as well. 

    If it is not the case, feel free to submit a support ticket where you can provide a sample project demonstrating the undesired behavior. Thus, our support staff will gladly assist you.

    I hope this information helps. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  18. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 07 Feb 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai dess... sorry for late reply.... 

    how to make this happen if i use Entity Framework for fill the col ... 

                For Each s In query_detail
                    RadGridView1.Rows.Add(s.Kode, s.NamaBarang, s.Qtty, s.Harga, s.Nilai)
                Next

                Dim col As GridViewMultiComboBoxColumn = New GridViewMultiComboBoxColumn("KodeBarang")
                Dim SqlBarang = From Barang In db.MstBarangs
                                Select New With {Barang.KodeBarang, Barang.NamaBarang}

                col.DataSource = SqlBarang.ToList

                col.DisplayMember = "NamaBarang"
                col.ValueMember = "KodeBarang"
                col.MinWidth = 100
                col.FieldName = "KodeBarang"
                Me.RadGridView1.Columns.Add(col)

    the code working fine, but with one miss ... it doesn't want to show the NamaBarang for the first time

  19. Hristo
    Admin
    Hristo avatar
    1519 posts

    Posted 08 Feb 2018 Link to this post

    Hi Hengky,

    You can check the following resources discussing in details how you can bind the grid using Entity Framework:
    From your code snippet, it appears that you are doing a select which returns anonymous types. Please avoid this as the grid would not be editable. This behavior can also be observed with the standard .NET grid control. The following articles provide more information on that matter: 
    I hope this information was useful.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  20. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 09 Feb 2018 in reply to Hristo Link to this post

    Hello Hristo, thanks for writing back... 

    i already bind the grid from EF. the blank column on the picture is MultiColumnComboBox... that fill with data to like example from Dess. ( if i use ado.net binding, its very well working) 

    How make this happen with EF.. ?

     

     

     

  21. Hristo
    Admin
    Hristo avatar
    1519 posts

    Posted 09 Feb 2018 Link to this post

    Hi Hengky,

    Binding the GridViewMultiComboBoxColumn to Entity Framework should not be much different compared to the grid. As demonstrated in the grid`s article please make sure that you load the collection in the DbContext and then access it through the Local property like this: 
    col.DataSource = dbContext.Orders.Local.ToBindingList();
     
    As I said before, please also make sure that you do not bind to a collection of anonymous types. In case you need further assistance, please open a support ticket and send us your project so that we can investigate it locally.

    Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  22. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 13 Aug Link to this post

    After return to telerik again .. i have facing this problem ... 

    The prog running very slowly .... 

    on selected data in gridviewcolumncombobox

            Dim dsBagian As New DataSet
            Using conn As New SqlConnection(str)
                conn.Open()

                da = New SqlDataAdapter("SELECT KodeBarang, NamaBarang FROM MstBarang " &
                                        "ORDER BY KodeBarang", conn)
                dsBagian = New DataSet
                dsBagian.Clear()
                da.Fill(dsBagian, "Barang")
                da.Dispose()
                conn.Close()
            End Using

            Dim col As GridViewMultiComboBoxColumn = New GridViewMultiComboBoxColumn("KodeBarang")
            col.DataSource = dsBagian.Tables("Barang")
            col.DisplayMember = "KodeBarang"
            col.MinWidth = 100
            col.ValueMember = "KodeBarang"
            col.FieldName = "KodeBarang"
            col.HeaderText = "Kode Barang"
            Me.RadGridView1.Columns.Add(col)

            Me.RadGridView1.Columns.Add(New GridViewTextBoxColumn("NamaBarang"))
            Me.RadGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
            RadGridView1.AutoGenerateColumns = False



            AddHandler Me.RadGridView1.ValueChanged, AddressOf ValueChanged
            AddHandler Me.RadGridView1.CellEditorInitialized, AddressOf CellEditorInitialized
            AddHandler RadGridView1.CellBeginEdit, AddressOf radGridView1_CellBeginEdit

  23. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 14 Aug Link to this post

    Hello, Hengky,

    According to the provided code snippet, it seems that you are extracting the data from a database. I suspect that this takes most of the time. It would be good to detect how much time the DataSet population takes.

    I have created a project with a GridViewMultiComboBoxColumn bound to Northwind.Categories table. It is bound immediately on my end. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem with it?

    Feel free to submit a support ticket from your Telerik account where you can provide a sample project demonstrating the performance problem that you are facing. Thus, we would be able to make an adequate analysis of the precise case and provide further assistance. Thank you in advance. 

    I am looking forward to your reply.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

  24. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 16 Aug in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai dess 

    I have created the project from the example that u gave to me long years ago ... 

    i have still facing the same problem .... because of this I tried the other product ... hehehehe....

    it's have faster performance then telerik ... with the same code ... but telerik have more friendly in GUI development ... 

    actually i just need to make in line add data with gridview ... 

     

    Hope u understand what i mean ...

  25. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 17 Aug Link to this post

    Hi, Hengky,

    Without replicating the issue locally, we can make only conjectures what causes the undesired slow loading on your end. Have you tried to run my sample project? Is it loaded as expected on your end? I would suggest you to detect how much time the DataSet population takes on your end. How many record do you have in the DataSet?

    Would it be possible to submit a support ticket from your Telerik account and provide a runnable sample project demonstrating the undesired behavior that you are facing? If it would be easier for you, feel free to modify the previously provided sample project.

    Once we replicate the issue locally, we would be able to investigate the precise case and think about a suitable solution.

    An alternative solution that is worth considering is using a RadPopupEditor and hosting either RadGridView in the popup container or a RadVirtualGrid.

    The following example demonstrates how to get started with the RadPopupEditor and host the desired controls in the container: https://docs.telerik.com/devtools/winforms/controls/editors/popupeditor/getting-started 

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

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

  26. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 18 Aug in reply to Dess | Tech Support Engineer, Sr. Link to this post

    hello dess ...

    i just need to make this ...

    I have 9k rows... 

    so to make faster i made the search form i called "frmCari" 

    if it's blank or hit commandcell it will open frmCari ... 

    on "OK" click it will return the value of column 1 & 2 in FrmCari 

    what i get is, always error if the row blank .... (or new state)

     

    Thanks dess 

     

  27. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 18 Aug Link to this post

    Hello, Hengky,

    According to the provided information, it is not clear what is the exact implementation that you have on your end and why the error message occurs. Could you please specify the exact steps how to reproduce the problem?

    It would be greatly appreciated if you can provide a complete code snippet related to the two forms illustrated on your screenshot. Thus, we would be able to replicate the undesired behavior locally and investigate further what happens.

    Thank you in advance for your cooperation. I am looking forward to your reply.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

  28. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 18 Aug in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai dess 

    finally i found the solution for my self 

    just simple code 

        Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
            If baris = -1 Then
                RadGridView1.Rows.Add("baru")
            Else
                RadGridView1.Rows(baris).Cells(0).Value = RadTextBox1.Text
            End If

    end sub 

  29. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 19 Aug Link to this post

    Hai Dess ... this the code ... 

    Public Class Form1

        Private isColumnAdded As Boolean
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

            Dim dsBagian As New DataSet
            Using conn As New SqlConnection(str)
                conn.Open()

                da = New SqlDataAdapter("SELECT KodeBarang, NamaBarang FROM MstBarang " &
                                        "ORDER BY KodeBarang", conn)
                dsBagian = New DataSet
                dsBagian.Clear()
                da.Fill(dsBagian, "Barang")
                da.Dispose()
                conn.Close()
            End Using

            Dim col As GridViewMultiComboBoxColumn = New GridViewMultiComboBoxColumn("KodeBarang")
            col.DataSource = dsBagian.Tables("Barang")
            col.DisplayMember = "KodeBarang"
            col.MinWidth = 100
            col.ValueMember = "KodeBarang"
            col.FieldName = "KodeBarang"
            col.HeaderText = "Kode Barang"
            Me.RadGridView1.Columns.Add(col)

            Me.RadGridView1.Columns.Add(New GridViewTextBoxColumn("NamaBarang"))


            AddHandler Me.RadGridView1.ValueChanged, AddressOf ValueChanged
            AddHandler Me.RadGridView1.CellEditorInitialized, AddressOf CellEditorInitialized
            AddHandler RadGridView1.CellBeginEdit, AddressOf radGridView1_CellBeginEdit


        End Sub
        Private Sub radGridView1_CellBeginEdit(ByVal sender As Object, ByVal e As GridViewCellCancelEventArgs)
            If TypeOf Me.RadGridView1.CurrentColumn Is GridViewMultiComboBoxColumn Then
                If (Not isColumnAdded) Then
                    isColumnAdded = True
                    Dim editor As RadMultiColumnComboBoxElement = CType(Me.RadGridView1.ActiveEditor, RadMultiColumnComboBoxElement)
                    editor.EditorControl.MasterTemplate.AutoGenerateColumns = False
                    editor.EditorControl.Columns.Add(New GridViewTextBoxColumn("KodeBarang"))
                    editor.EditorControl.Columns.Add(New GridViewTextBoxColumn("NamaBarang"))
                    editor.DropDownWidth = 300
                    editor.AutoSizeDropDownToBestFit = True
                    editor.Columns("NamaBarang").AllowResize = True
                End If
            End If
        End Sub

        Private Sub ValueChanged(sender As Object, e As EventArgs)
            Dim mccb As RadMultiColumnComboBoxElement = TryCast(Me.RadGridView1.ActiveEditor, RadMultiColumnComboBoxElement)
            If mccb IsNot Nothing Then
                Dim rowInfo As GridViewDataRowInfo = TryCast(mccb.SelectedItem, GridViewDataRowInfo)
                Me.RadGridView1.CurrentRow.Cells("KodeBarang").Value = rowInfo.Cells("KodeBarang").Value
            End If
        End Sub

        Private Sub CellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
            Dim mccb As RadMultiColumnComboBoxElement = TryCast(e.ActiveEditor, RadMultiColumnComboBoxElement)
            If mccb IsNot Nothing Then
                mccb.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
                mccb.AutoFilter = True
                If mccb.EditorControl.FilterDescriptors.Count = 0 Then
                    Dim filter As New FilterDescriptor()
                    filter.PropertyName = mccb.DisplayMember
                    filter.Operator = FilterOperator.Contains
                    mccb.EditorControl.MasterTemplate.FilterDescriptors.Add(filter)
                End If
            End If
        End Sub

    End Class

     

    I have 9k row data in "Barang"

  30. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3899 posts

    Posted 19 Aug Link to this post

    Hello, Hengky,

    Following the provided code snippet, I have updated my sample project. It seems that you are using the filtering functionality in the GridViewMultiComboBoxColumn. Indeed, with 9000 rows in the RadMultiColumnComboBoxElement editor, there is a slight delay because the filtering is performed on each key stroke and there are a lot of records to iterate and find the matches. 

    Since R2 2017 version, you can improve the user experience with cursor lagging while filtering in the editor. In the CellEditorInitialized event you can set the RadMultiColumnComboBoxElement.AutoFilterDelay property to 1000 for example. Thus, you can specify the value in milliseconds indicating delay between last key press and filtering operation. 
        Private Sub CellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
            Dim mccb As RadMultiColumnComboBoxElement = TryCast(e.ActiveEditor, RadMultiColumnComboBoxElement)
            If mccb IsNot Nothing Then
                mccb.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown
                mccb.AutoFilter = True
                If mccb.EditorControl.FilterDescriptors.Count = 0 Then
                    Dim filter As New FilterDescriptor()
                    filter.PropertyName = mccb.DisplayMember
                    filter.Operator = FilterOperator.Contains
                    mccb.EditorControl.MasterTemplate.FilterDescriptors.Add(filter)
                    mccb.AutoFilterDelay = 1000
                End If
            End If
        End Sub
    I hope this information helps. If you need any further assistance please don't hesitate to contact me.  

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

Back to Top