Add GridViewComboBoxColumn to exisiting column

1 posts, 0 answers
  1. Won
    Won avatar
    15 posts
    Member since:
    Sep 2010

    Posted 04 Oct 2010 Link to this post

    Please, remove this post. I moved it to Gridview forum. This was wrong place. Sorry!

    Hi! 
    I am trying to implement GridViewComboBoxColumn on gridview for existing"DEPARTMENT_ID"
    colum.
    I tried below and it works fine, but it is adding another column on the gridview instead of replacing existing "DEPARTMENT_ID" column.
    1. What should I change?
    2. What property will remove a scroll bar on GridViewComboBoxColumn?

     
     With Me.rgvEmployee
                .Columns("EMP_ID").HeaderText = "EMP ID"

                Dim deptComboboxColumn As GridViewComboBoxColumn = New GridViewComboBoxColumn
                With deptComboboxColumn
                    .UniqueName = "DeptColumn"
                    .HeaderText = "Dept"
                    .DataSource = From q In db.MST_DEPARTMENT _
                                  Select q.DEPARTMENT_ID, q.DEPARTMENT_NM
                    .ValueMember = "DEPARTMENT_ID"
                    .DisplayMember = "DEPARTMENT_NM"
                    .FieldName = "DEPARTMENT_ID"
                    .Width = 200
                End With
                Me.rgvEmployee.Columns.Add(deptComboboxColumn)

            End With
Back to Top