开发者

MVCContrib Grid custom design

I would like to reproduce the following design

+-----------------------------------+---+---+
| some text here                    | A | B |
+-----------------------------------+---+---+
| some multiline text here                  |
+-------------------------------------------+

Where A an开发者_开发知识库d B are fixed width columns containing images.

This would be easily accomplished using a <table> element like this

<table>
    <tr>
        <td>some text here</td>
        <td width="20"><img alt="" src="/imageurl" /></td>
        <td width="20"><img alt="" src="/imageurl" /></td>
    </tr>
    <tr><td colspan="3">some multiline text here</td></tr>
</table>

But I am using the Grid helper within the MVCContrib project. Is there a way to obtain a design like this one for every item inside a list of items?


You can implement your own GridRenderer. From Jeremy Skinner's blog:

The default GridRenderer is the HtmlTableGridRenderer. Which, surprisingly enough, renders the grid as an HTML table. By specifying your own GridRenderer, you can completely alter how the grid is rendered without resorting to completely rewriting the grid component.

You can get some ideas from HtmlTableGridRenderer's source code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜