A
ABHIJIT B
Hi,
I am using GridView in my web form and binding DataTable in code
behind file as given below.
gvUsersList.DataSource = dtUserList;
gvUsersList.DataBind();
If no records exists in DataTable GridView should display Coulmn
Header text.
In my case I have enabled following property,
gvUsersList.ShowHeader = true;
It is not working so tried following code which works for DataGrid but
not for GridView
dtUserList.Columns.Add(new DataColumn("LoginID",
typeof(string)));
dtUserList.Columns.Add(new DataColumn("FirstName",
typeof(string)));
dtUserList.Columns.Add(new DataColumn("LastName",
typeof(string)));
gvUsersList.DataSource = dtUserList;
gvUsersList.DataBind();
gvUsersList.ShowHeader = true;
Kindly help me where I am doing mistake or GridView property which
needs to be set.
Regards,
Abhijit B
I am using GridView in my web form and binding DataTable in code
behind file as given below.
gvUsersList.DataSource = dtUserList;
gvUsersList.DataBind();
If no records exists in DataTable GridView should display Coulmn
Header text.
In my case I have enabled following property,
gvUsersList.ShowHeader = true;
It is not working so tried following code which works for DataGrid but
not for GridView
dtUserList.Columns.Add(new DataColumn("LoginID",
typeof(string)));
dtUserList.Columns.Add(new DataColumn("FirstName",
typeof(string)));
dtUserList.Columns.Add(new DataColumn("LastName",
typeof(string)));
gvUsersList.DataSource = dtUserList;
gvUsersList.DataBind();
gvUsersList.ShowHeader = true;
Kindly help me where I am doing mistake or GridView property which
needs to be set.
Regards,
Abhijit B