views:

52

answers:

3

I need to display a table with various info (names, dates, serial numbers, notes). In addition, there is one field I need to be one of three specified values (Raise, Lower, Release). What view would be the best/easiest to implement which would let me add/edit/delete entries as well as provide a drop down option for the Raise, Lower, Release options?

Thanks in advance!

+1  A: 

Sounds like a GridView is what your after, you want the ability to add/edit/delete and you might make use of DetailsView from your rows in the GridView (may or may not be useful to you but for adding new records you'll probably want it in coordination with the GridView), the ListView would be too simplistic for what your after I think.

You'll need a TemplateField for your column that has the drop down options for those three specific values as well.

Capital G
+2  A: 

All of them can do that. I use a DetailsView and GridView if i just want to display data that in straight columns and rows. The DetailsView shows 1 record per page and let's you do all you want. I personally use it for Edit and Insert. The GridView i use for Showing and Deleting.

The ListView and FormView you use when you want show fancy data that doesn't let itself fit in neat rows and columns but more complex views. They too let you Edit/Insert/Delete.

To show a DropDownList in the DetailsView and GridView you convert a DataBoundField into a TemplateField.

Jeroen
+1  A: 

Depending on what you're doing (IE, is this integrated into a larger project or more of a standalone page), you might want to look at the Dynamic Data stuff. You can point it at your database and it will generate everything required to provide an editing interface on the data, including dropdowns for foreign key/lookup table values.

It also provides extension points do any kind of validation/business logic enforcement you might need.

Tim Coker