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
Amith Rai
NA
8
10.4k
How to populate the rows of a gridview at runtime?
Mar 11 2011 1:14 AM
Hi,
am working on a web-application with a database behind it. I would like to be able to populate the rows of a gridview at runtime, means based on a certain condition I need to decide, if a particular Row from the database should be displayed or not.
I tried selectively adding the rows to DataTable first, and then binding the DataTable to the GridView, but didn't work. The Code is below..
/*
StudentTableAdapter adapter = new StudentTableAdapter();
DataTable table = new DataTable();
foreach (DataRow row in adapter.GetStudentMarks())
{
String Branch = row["ProjectName"].ToString();
if (Branch.Equals("Computer-Science"))
{
table.Rows.Add(row);
}
}
GridView1.DataSource = table;
GridView1.DataBind();
*/
Thanks in advance.
Reply
Answers (
2
)
How to start programming on silverlight as i am a fresher
Image compression in the form of JPEG2000