Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1660
Dropdown in Wingrid with Valuelist
posted

We are using the windows application. In Datagrid we implement a style as Multi select dropdown for a particular cell using ValueList in vb.net. Selected items not showed in dropdown text, only one item will showed even we selected multiple items and also we get into the cell again, no items are selected which i selected earlier. 

Please provide us sample project in vb.net for the same.

Parents Reply
  • 6120
    Offline posted in reply to Thangachan Kuriyan

    Hello Thangachan,

    Please refer to the VB.net sample provided at the below link on how to implement multi select dropdown for the UltraGrid. 

    http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7698

    However, we added CheckListSettings property for the UltraCombo and UltraComboEditor in Infragistics for Windows Forms 2009 Vol2 version and above, which allows you to multi select the values within it without writing any custom code. There is a possibility of adding UltraCombo to an UltraGrid by doing something like this:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.BindUltraCombo()
    End Sub

    Private Sub BindUltraUltraCombo()

            Dim dt As DataTable = New DataTable()
            dt.Columns.Add("ID", GetType(Integer))
            dt.Columns.Add("DisplayText", GetType(String))

            dt.Rows.Add(New Object() {1, "A"})
            dt.Rows.Add(New Object() {2, "B"})
            dt.Rows.Add(New Object() {3, "C"})
            dt.AcceptChanges()

            Me.UltraCombo1
    .SetDataBinding(dt, Nothing)
            Me.UltraCombo1.ValueMember = "ID"
            Me.UltraCombo1.DisplayMember = "DisplayText"
    End Sub

    Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
            e.Layout.Bands(0).Columns("Int32 1").ValueList = Me.UltraCombo1
    End Sub

    You can refer to this link where this approach is explained. When using a ValueList in a Grid column set its type to Object array in order to allow it to render multiple values. What I was suggesting in my previous post was to use an UltraCombo instead of a multi select dropdown as it has the CheckListSettings (multiselect) functionality built into it. Then embed the UltraCombo into the Grid column by doing something like above.

    You can follow any of these approaches to achieve this.

    Please let me know if I may be of further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer

Children