如何根据gridview中数据库的值动态创建列宽 [英] how to dynamically create a column width based on value from database in gridview

查看:104
本文介绍了如何根据gridview中数据库的值动态创建列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据网格视图中数据库的值更改列宽。



假设数据库ram中的值创建的列宽度不同

如果值是来自数据库的'ramakrishna',则列宽度是动态创建的。

解决方案

您不必为此做任何事情。 。

Quote:

默认情况下,GridView控件中的列会自动调整大小。列呈现为HTML表格单元格( td元素)没有宽度信息;大多数浏览器调整表格单元格大小以允许列中最宽的内容。





来源: http://msdn.microsoft.com/en-us/library/ms178296(v = VS.100 ).ASPX [ ^ ]


how to change a column width based on value from database in grid view.

suppose the value in database 'ram" the column width create differently
if the value is 'ramakrishna' from database that's time the column width create dynamically.

解决方案

You don't have to do anything for this..

Quote:

By default, columns in the GridView control are sized automatically. Columns render as HTML table cells (td elements) without width information; most browsers size table cells to allow for the widest content in the column.



source: http://msdn.microsoft.com/en-us/library/ms178296(v=vs.100).ASPX[^]


这篇关于如何根据gridview中数据库的值动态创建列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆