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

Discussion in 'ASP .Net' started by Alan Silver, Feb 16, 2005.

  1. Alan Silver

    Alan Silver Guest

    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)
    Alan Silver, Feb 16, 2005
    #1
    1. Advertising

  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/d...questionsaboutaspnetdatagridservercontrol.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "Alan Silver" <> wrote in message
    news:...
    > 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)
    Steve C. Orr [MVP, MCSD], Feb 16, 2005
    #2
    1. Advertising

  3. Alan Silver

    Alan Silver Guest

    >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.

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Feb 16, 2005
    #3
  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/d...questionsaboutaspnetdatagridservercontrol.asp
    (look near the end)

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "Alan Silver" <> wrote in message
    news:...
    > >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.
    >
    > --
    > Alan Silver
    > (anything added below this line is nothing to do with me)
    Steve C. Orr [MVP, MCSD], Feb 16, 2005
    #4
  5. Alan Silver

    Alan Silver Guest

    >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.

    --
    Alan Silver
    (anything added below this line is nothing to do with me)
    Alan Silver, Feb 16, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    3
    Views:
    559
    samuelhon
    Nov 16, 2006
  2. Replies:
    0
    Views:
    572
  3. Replies:
    4
    Views:
    169
    Joe Smith
    May 4, 2007
  4. oldyork90
    Replies:
    1
    Views:
    148
    Jeremy J Starcher
    Sep 10, 2008
  5. Mike Copeland
    Replies:
    5
    Views:
    483
    Ian Collins
    Apr 14, 2012
Loading...

Share This Page