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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Nov 20, 2013, 5:41 AM
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 TrivediPosted Nov 20, 2013, 5:40 AM
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.
piyusha patravaliPosted Nov 20, 2013, 4:59 AM
on web page
Jignesh TrivediPosted Nov 20, 2013, 4:24 AM
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