Asp.net DetailsView - multiple columns?
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
精彩评论