请问在DataGrid中如何实现一条记录占用多行?
RT 问题点数:20、回复次数:8Top
1 楼drason(天道酬勤)回复于 2003-09-02 23:12:17 得分 0
怎么没有人?
自己顶一下Top
2 楼saucer(思归)回复于 2003-09-02 23:17:30 得分 15
override ItemCreated or ItemDataBound event and programmatically create new DataGridItem
or use DataList/Repeater to format the records yourselfTop
3 楼drason(天道酬勤)回复于 2003-09-02 23:26:56 得分 0
我的意思是:从数据库里面读入的每行记录的列数太多,要分成两行在DataGrid显示Top
4 楼drason(天道酬勤)回复于 2003-09-02 23:29:13 得分 0
To 思归:Can you explain more clearly?Top
5 楼ceocio(成都招聘.Net工程师,有意者请联系我)回复于 2003-09-02 23:32:29 得分 5
可以,使用模板列自己定义样式就行了。具体请看:
http://www.csdn.net/develop/read_article.asp?id=20576Top
6 楼drason(天道酬勤)回复于 2003-09-02 23:42:18 得分 0
To ceocio(MS Community Star) :我不用Martrix的~~Top
7 楼saucer(思归)回复于 2003-09-02 23:48:20 得分 0
see
http://www.xmlforasp.net/CodeBank/System_Data/DataSet/GroupingGrid/GroupingGrid.aspx
the code is here:
http://www.xmlforasp.net/codebank/util/srcview.aspx?path=../../codebank/system_data/DataSet/GroupingGrid/GroupingGrid.src&file=GroupingGrid.aspx.cs&font=3
but if I were you, I would use Repeater, for example
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"col1")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col2")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col3")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col4")%></td>
</tr>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"col5")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col6")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col7")%></td>
<td><%# DataBinder.Eval(Container.DataItem,"col8")%></td>
</tr>
</ItemTemplate>Top
8 楼drason(天道酬勤)回复于 2003-09-03 00:12:33 得分 0
多谢思归~~
问题我想已经解决了
明天上班再测试
明天结贴~~Top




