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
Gopal Mahadak
NA
316
154.5k
Datagridview in c#
May 19 2013 5:28 AM
Here is the my code to add columns to datagridview runtime :
DataGridViewComboBoxColumn c5 = new DataGridViewComboBoxColumn();
c5.HeaderText = "Item_SrNo";
con.connCheck();
OleDbCommand cmd = new OleDbCommand("select Item_SrNo from Item_Master", con.cn);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read()==true)
{
c5.Items.Add(dr["Item_SrNo"].ToString());
}
dataGridView1.Columns.Add(c5);
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Item_Code", typeof(string)));
dt.Columns.Add(new DataColumn("Sale_Unit", typeof(string)));
dt.Columns.Add(new DataColumn("Inventory_Rate", typeof(int)));
dataGridView1.DataSource = dt;
Here when i press 'enter' in datagridview then comboBox list dropdowns Please Help me...
Reply
Answers (
1
)
stop clock using windows forms control library ?
How to change bool to string value from DataGridView?