Asp.net DetailsView - 多列?
默认情况下,DetailsView 支持 2 列。我想添加第三列。使用DetailsView 可以实现这一点吗?在每个字段中创建一个表格并不能达到我想要的效果,因为第三列无法正确对齐。
我知道我可以使用其他控件,例如 DataList,但是具有类型化的 asp:HyperLinkField / asp:CheckBoxField / 等 DetailsView 和相应的属性非常方便。
是否存在两全其美(DataList 的灵活性和DetailsView 的内置简写对象)?
By default, DetailsView supports 2 columns. I'd like to add a third column. Is this possible using DetailsView? Creating a table within each field doesn't do what I'd like as the third column won't be properly aligned.
I know I can use other controls such as DataList, but having the typed asp:HyperLinkField / asp:CheckBoxField / etc of DetailsView and corresponding properties is extremely convenient.
Does the best of both worlds (the flexibility of DataList and the built-in shorthand objects of DetailsView) exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想要自定义模板&布局中,您应该使用
FormView
,因为它的行为和事件与detailsView 相同。查看 MSDN
和使用 FormView 的模板
If you want a custom template & layout, you should use
FormView
, as it will behave and have the same events as the detailsView.Take a look at MSDN
and Using the FormView's Templates
我不确定您为什么认为 DetailsView 仅支持两列。 MSDN 上有一个具有多个列(字段)的综合示例:
详细信息查看类
I'm not sure why you think DetailsView supports only two columns. There's a comprehensive example on MSDN that has multiple columns (fields):
DetailsView Class