ASP.NET Design Issue: what is the best asp.net control for creating a table with 15 properties?

214 Views Asked by At

I am a new ASP.NET developer and now I need to develop a data entry system with 15 fields that allow the admin of the system to enter some data under each one of these 15 properties. From what I learned in ASP.NET tutorial, I think the best control is the ListView control in order to give the admin of the system to enter a new field if he wants in the future. My problem now is the following: How to divide these 15 fields into two columns? Because all what I see about using ListView is putting all of the properties at the first row and the entries will be underneath of them. What I want is to create a list with two columns of properties and two columns for the entries

3

There are 3 best solutions below

0
On BEST ANSWER

I'm not sure that a ListView makes sense from your description. Are your administrators updating the same properties on different objects? Like most of the ASP.NET controls in its class -- the Repeater and GridView are other similar examples -- the ListView is meant to create several rows of identical information based on an HTML template you provide.

If your administrators are creating or updating:

  • The same property for different objects, then the ListView, Repeater, or GridView would be fine.
  • Different properties for the same or different objects, then you need a more traditional form with normal data entry controls (like the TextBox, HtmlSelect or DropDownList, CheckBox, etc.)
0
On

If you're looking to use the edit features of a data control, you could create a custom item template for your data control (be it a gridview or whatnot) that has a table and each of the properties (I assume all 15 are conisidered 1 row of data). Bind your single row to the data control and it should work. You could even have different template views for display and editing using the templates.

0
On

I would use a more liberate approach and code the fields my self into the view you'd like.

At first it might take more time, but after that your would be able to control the look of it much quicker and easily.

Using a listView you can build your edit/input gui as you'd like - a table or any other way. If really must divide into 2 columns - you could just put a label and then the field just underneath it. 7 on one side and 8 on the other.