What's the best way to handle showing/editing this data?

A

Alan Silver

hello,

I have a database table that stores names of schools, and I want o write
a page that allows someone to change the list.

I was wondering about showing the schools in a table, with existing
school names being in textboxes, each with a "delete" checkbox.
Modifying a school name would involve typing the changes in the textbox
and clicking a Submit button. Deleting a school would involve checking
the school(s) to be deleted, and then clicking a Delete button. Adding a
new school would be done via a separate textbox below the table.

All of this sounds fine (to me), but I'm a bit lost as to how to go
about it. I could use a repeater control to generate the table, but I'm
not sure the best way to add the textboxes. The problem is that I don't
know how you would specify the ID, as you would have loads of textboxes
with the same ID. Same problem goes for the checkboxes.

Anyone any idea how I would do this? Some simple code would help if you
can as I'm fairly new at this and a bit of code speaks a thousand words
;-)

Thanks for any help you can give
 
A

Alan Silver

The standard datagrid supports all the functionality you mentioned.
I suggest you use it.
Here are some code samples:
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vste
chart/html/vbtchtopquestionsaboutaspnetdatagridservercontrol.asp

Steve,

Thanks for the links. I had looked at the data grid and it does do all
of this. Since posting, I have built a page that allows the full works
on the list. I am amazed at how easy this stuff is in ASP.NET.

However, the one thing I don't like about it is the number of clicks you
need to do anything.

For example, to edit something, you have to click an "edit" link, then
change the text, then click a "save" link. If you need to do a few this
can take time. I was hoping to be able to show the data in text boxes,
allow the user to change as many as they like right there on the list
and click one "Update" button.

This is all based on the samples I have seen with the data grid. If you
know a way of doing what I want with the data grid, please enlighten me.
What I have works, and is basically acceptable, but it isn't really
user-friendly as it requires the user to make clicks that are of no
benefit to him. I would like to improve on that.

Thanks for the reply.
 
A

Alan Silver

This shows how to allow editing multiple rows at once, which could save them
some time in this scenario:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vste
chart/html/vbtchtopquestionsaboutaspnetdatagridservercontrol.asp
(look near the end)

Thanks, that's exactly what I want to do. Trouble is (as usual with MS),
the author assumed you have VS (I don't) and relied on that. He doesn't
supply enough code to show what the effects of some of the VS commands
is.

never mind, I'll still have a look and see how far I get. Thanks for the
link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top