Hi..
I have the following in my "MyDesigns.css" file -
.table{Border="2"}.table th,
.table td{padding:8px;}
.table th{font-weight:bold;}
-------------
How to call this in GridView controls ??
Eg -
Here, the class ".table th" is used with ".table".
If I want to call this in GridView HeaderStyle CSS Class, how do I call ??
PLease help !
Loading
Anil KumarPosted Mar 4, 2015, 5:53 AM
Literal cssFile = new Literal() { Text = @"myCss.css) + @""" type=""text/css"" rel=""stylesheet"" />" };
Riddhi ValechaPosted Mar 4, 2015, 2:01 AM
I have called this is .aspx page.
But, how to apply this in code-behind (.aspx.cs file) in RowDataBound Event !!
I have written the following -
if (e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell2 in e.Row.Cells)
{
cell2.Attributes.Add("class", "Header");
}
}
Anil KumarPosted Mar 4, 2015, 1:39 AM
OR
or rel="stylesheet" type="text/css" href="styles/myCss.css" />
Riddhi ValechaPosted Mar 4, 2015, 1:00 AM
My css files (MyCss.css) is in "Styles" Folder in the solution.
How to access that ??
I have given Heading - yellow colour and rest of gridview is simple and plane.
Anil KumarPosted Mar 3, 2015, 9:22 AM
OR Simply
MyGridView.CssClass = "myCssClass";
To help others, Please mark solution as Accepted if it solves the purpose
Riddhi ValechaPosted Mar 3, 2015, 7:56 AM
My issue is -
I am getting data from database in datatable and I have assigned this datatable to gridview.
i.e.
Grd_User.Datasource = datatable;
Grd_User.Databind();
---
Property Autogeneratecolumns = true.
--------
The css wokrs fine when I write
and
Property Autogeneratecolumns = false.
------------------
But, I do not want to write this
------
For that, I tried doing in RowDataBound Event. But, even that is not working.
----
Any other solution ??
Please help....
NitinPosted Feb 25, 2015, 8:16 AM
CssClass="table"
Anil KumarPosted Feb 24, 2015, 11:35 AM