hi all
I have table called StudentMaster where i have ID and Name
Now I want to create an empty gridview on page load which contains this student Names as a Header of the columns.Please Help..
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 19, 2013, 11:24 PM EST
I am not able to understand your question.
you want student's name which is present in database as column name or any thing else?
Please provide more information
piyusha patravali39 reputationPosted Nov 19, 2013, 11:59 PM EST
on web page
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 20, 2013, 12:40 AM EST
Hi,
This is some what odd requirement but try....
DataTable dt = GetStudentList(); // from this method get student detail like name which is required.
DataTable dtNew = new DataTable();
dtNew.Columns.Add(dt.Rows[0]["Name"].ToString());
//Now this dt assigh to your grid
gridview1.DataSouce = dtNew;
hope this will help you.
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 20, 2013, 12:41 AM EST
Hi,
This is some what odd requirement but try....
DataTable dt = GetStudentList(); // from this method get student detail like name which is required.
DataTable dtNew = new DataTable();
dtNew.Columns.Add(dt.Rows[0]["Name"].ToString());
//Now this dt assigh to your grid
gridview1.DataSouce = dtNew;
hope this will help you.