TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kal k
NA
9
0
datagridviewcomboboxcolumn
May 31 2006 10:18 AM
Hi,
My requirement is to set combobox column for deptno column of the table dept.
When insert button is clicked,i write the following code
DataGridViewComboBoxColumn cell = new DataGridViewComboBoxColumn();
cell.DataPropertyName = "DEPTNO";
cell.HeaderText = "dno";
cell.Items.Add(10);
cell.Items.Add(20);
cell.DataSource = ds.Tables["dept"];
cell.ValueMember = "DEPTNO";
cell.DisplayMember = "deptno";
dataGridView1.Columns.Add(cell);
dt=new DataTable();
dt = (DataTable)dataGridView1.DataSource;
DataRow dr = dt.NewRow();
dt.Rows.Add();
dataGridView1.DataSource = dt;
My problem is that combobox column is displayed as a separate column.But it value member set to deptno column of dept table.And when i select 30 from that combo box control goes to deptno=30 row.
I want combox cell is set for deptno column and when we select a value from that combo box column the velue is displayed for that row.
How to do this.
Thanks in advance.
Reply
Answers (
0
)
sortcode for DataGrid control
Some error for Control Array when upgrade VB to VB.NET.Do me a favor.