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

Add GridViewComboBoxColumn to exisiting column

0 Answers 57 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Won
Top achievements
Rank 1
Won asked on 05 Oct 2010, 01:47 AM
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
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Won
Top achievements
Rank 1
Share this question
or