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
baskaran chellasamy
NA
114
151k
problem in binding data to gridview
Nov 5 2012 1:45 PM
The below is my code for binding data to gridview. This method for creating datagridview column Collapse | Copy Code public void designgrid() { DataGridViewColumn firstcolumn=dataGridView1.Columns[1]; DataGridViewCell cell=new DataGridViewTextBoxCell(); firstcolumn.CellTemplate=cell; firstcolumn.HeaderText = "AdmissionNumber"; firstcolumn.Width = 50; DataGridViewColumn secondcolumn = dataGridView1.Columns[2]; DataGridViewCell cell1 = new DataGridViewTextBoxCell(); secondcolumn.CellTemplate = cell1; secondcolumn.HeaderText = "StudentName"; secondcolumn.Width = 80; DataGridViewColumn Thirdcolumn = dataGridView1.Columns[3]; DataGridViewCell cell2 = new DataGridViewTextBoxCell(); Thirdcolumn.CellTemplate = cell1; Thirdcolumn.HeaderText = "StanderedName"; Thirdcolumn.Width = 80; DataGridViewColumn forthcolumn = dataGridView1.Columns[4]; DataGridViewCell cell3 = new DataGridViewTextBoxCell(); forthcolumn.CellTemplate = cell3; forthcolumn.HeaderText = "RegisterNumber"; forthcolumn.Width = 50; DataGridViewColumn fifthcolumn = dataGridView1.Columns[5]; fifthcolumn = new DataGridViewComboBoxColumn(); fifthcolumn.HeaderText = "SortNo"; fifthcolumn.Width = 50; } This code for binding data to gridview Collapse | Copy Code DataTable studentbind = ibl4.studentbindforfemale(sdt); int rowcount = studentbind.Rows.Count; List
no = ibl4.setnoofint(rowcount); int registerno = ibl4.getregiter(sdt); designgrid(); for(int i=0;i
Reply
Answers (
0
)
How can bind data to textbox and combobox in gridview
Why CacheItemRemovedReason should be used in Cache concepts of asp.net?