|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid HeaderStyle.CssClass applied to <tr>I am building a datagrid based on a datatable. I am attempting to apply a style value using the syntax Datagrid.HeaderStyle.CssClass="mystyle". When the datagrid renders, the style is applied at the row level (example below) <tr class="mystyle" align="Left" valign="Top"> <td>Name</td><td>City</td><td>Begin Date</td><td>Category</ td><td>Calendar</td></tr> I need it to apply at the column level <tr align="Left" valign="Top"> <td class="mystyle">Name</td><td class="mystyle">City</td><td class="mystyle">Begin Date</td><td class="mystyle">Category</td><td class="mystyle">Calendar</td></tr> I can't figure this out. Can you help? Thanks. Randy Randel wrote:
Show quoteHide quote > Hi. Hi,> > I am building a datagrid based on a datatable. I am attempting to > apply a style value using the syntax > Datagrid.HeaderStyle.CssClass="mystyle". > > When the datagrid renders, the style is applied at the row level > (example below) > <tr class="mystyle" align="Left" valign="Top"> > <td>Name</td><td>City</td><td>Begin Date</td><td>Category</ > td><td>Calendar</td></tr> > > I need it to apply at the column level > <tr align="Left" valign="Top"> > <td class="mystyle">Name</td><td class="mystyle">City</td><td > class="mystyle">Begin Date</td><td class="mystyle">Category</td><td > class="mystyle">Calendar</td></tr> > > I can't figure this out. Can you help? > > Thanks. Randy Add to stylesheet: ..mystyle td { //cell style properties } It applies to table cell. But the grid header usually renders as "<tr><th ..." and not "<tr><td ...". In this case use ..mystyle th { }
AJAX and embeded controls
Highlight a clicked row in a gridview linked to a css menu navigation control and CSS interference GridView Header Height Newbie, error between asp.net 1.1 and asp.net 2.0 why is this html table still visible? Put the date of today in a text control How do I reposition Controls inside Panel in designer page is postback while using validation Select certain columns from datagrid |
|||||||||||||||||||||||