|
Rank: Advanced Member Groups: Member
Joined: 3/9/2010 Posts: 119
|
I'm trying to control the border of a grid cell but the bottom won't show regardless of the grid's itemHeight property. Any idea how to fix this? I'm using the following style -
Code: CSS
color:#00008B;background-color:#FFFFFF;font-weight:normal;text-align:center;vertical-align:middle;border-color:#FF00FF #FF00FF #FF8C00 #FF8C00;border-style: solid;border-width:2px;
And this is the result -
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Please try to use a DIV inside the Grid cell and apply the border on that DIV instead. The Grid cells are intentionally overlapped together so that the top border of the cell below overlaps the bottom border of the cell above. This is needed to create border line similar to a table's border-collapse option. As a result, border bottom won't work properly on the Grid cell.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 3/9/2010 Posts: 119
|
Can you point me to an example of how to add a div to the cell?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can either use GridColumn.DataFormat to include wrapper HTML or set the cell value to raw HTML value. For example, if your data value is "abc", you can set DataFormat to "<div>{0}</div>" to include extra DIV for the cell, or set cell value to "<div>abc</div>". Both method will display "<div>abc</div>" in the cell when the cell is rendered.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 3/9/2010 Posts: 119
|
I've added DataFormat="<div>{0}</div>" to the column but it didn't affect the display. Should the StyleField value be applied to the DIV or do I need to remove the StyleField and apply the style to the DIV?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
It won't change anything just because you added a DIV tag. You will need to add whatever style you want to add onto that DIV tag. That's the whole point of adding a DIV (or whatever other elements you want to add), so that you can apply styles to it yourself.
|
|