设置 radgrid 中字符串的最大长度/使用自动生成列限制 radgrid 中的字符串长度
有什么方法可以告诉 radgrid 截断其列中字符串的长度吗?我使用 radgrid 来显示来自 sql 视图的数据,该视图具有多个(很多很多)字段,所以我想使用 autogeneratefields="true" 而不是设置所有 gridboundcolumns,和/或在 itemdatabound 中进行截断事件或类似的事情。
我想我也可以这样问,从视图中获取数据并使字段仅返回前 x 个字符的好方法是什么?正如我所说,有很多字段,所以我不想对我的 dal 中的每一列进行编码并执行子字符串或类似的操作......
有什么想法吗?
谢谢!
生锈的
Is there any way to tell a radgrid to truncate the length of strings in its columns? Im using a radgrid to show data from a sql view which has several (many, many) fields, so I want to use the autogeneratefields="true" rather than setting up all of the gridboundcolumns, and/or doing the truncation in the itemdatabound event or anything like that.
I suppose I could ask it this way also, what would be a good approach to getting data back from a view and have the fields only return the first x number of characters? As I said there are many fields so I don't want to have to code out every column in my dal and do a substring or something like that....
Any thoughts?
Thanks!
Rusty
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定我的问题是否有意义,但如果有人遇到类似的情况,我最终会循环遍历对象的属性并在 radgrid 上设置数据源之前截断字符串。
这种方法取自此处:如何迭代自定义 vb.net 对象的每个属性?
干杯,
生锈了
Not sure if my question made sense, but in case anyone comes across a similar scenario, I ended up looping through my object's properties and truncated the strings before setting the datasource on the radgrid.
This approach was taken from here : How to iterate through each property of a custom vb.net object?
cheers,
rusty