467,925 Members | 2,013 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

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

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

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
  • viewed: 1076
Share:
4 Replies
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/de...vercontrol.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alan Silver" <al*********@nospam.thanx> wrote in message
news:W7**************@nospamthankyou.spam...
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

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #2
>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/de.../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.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3
This shows how to allow editing multiple rows at once, which could save them
some time in this scenario:
http://msdn.microsoft.com/library/de...vercontrol.asp
(look near the end)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alan Silver" <al*********@nospam.thanx> wrote in message
news:y3**************@nospamthankyou.spam...
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/de.../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.

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #4
>This shows how to allow editing multiple rows at once, which could save them
some time in this scenario:
http://msdn.microsoft.com/library/de.../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.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Andrew Dorph | last post: by
reply views Thread by Alan Silver | last post: by
4 posts views Thread by T.Jackson | last post: by
2 posts views Thread by Paulo Roberto | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.