日期:2014-05-20  浏览次数:20480 次

复杂的dataGrid的问题 高手请进.分不够再加
要创建这样的一个DataGrid的:

----------------------------------------------------
|                                                     | 其他人情况                         |
|投资企业|注册时间|注册资本|------------------------|
|                                                     |投资人名称|金额|...   |...|
----------------------------------------------------

这是datagrid标头,(画的很糙请将就点)"其他人情况"下的"投资人名称"和
"金额"可能是一组数据 也有可能是两组 三组.

该如何解决?数据库如何设计更合理些?




------解决方案--------------------
孟子的网站里有
http://dotnet.aspx.cc/article/01c21aa8-7de7-4c5d-ab0c-4736e259b773/read.aspx
------解决方案--------------------
可以参照孟子的文章,
然后把dataGrid的列头隐藏就可以了
------解决方案--------------------
Literal newCells = new Literal();
newCells.Text = @ "表头文字1 </th>
<th colspan= '2 '> 表头文字2 </th>
<th colspan= '2 '> 表头文字3 </th>
<th> 表头文字4 </th>
</tr>
<tr bgcolor= ' " + HeaderBackColor + " '> ";
newCells.Text += @ "
<th colspan= '2 '> 表头文字5 </th>
<th rowspan= '2 '> 表头文字6 </th>
<th colspan= '2 '> 表头文字7 </th>
</tr>
<tr bgcolor= ' " + HeaderBackColor + " '> ";
newCells.Text += @ "
<th> 表头文字8 </th>
<th> 表头文字9 </th>
<th> 表头文字10 </th>
<th> 表头文字11 </th>
<th> 表头文字12 ";
通过判断有几组金额.把上面的动态生成,应该可以实现
主要就是
| 其他人情况 |
这行要跨多少列,这个生成了后,循环添加
|投资人名称|金额|... |...|