开发者

Asp.net DetailsView - multiple columns?

开发者 https://www.devze.com 2023-03-22 17:21 出处:网络
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 colum开发者_Sta

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 colum开发者_StackOverflow社区n 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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消