Gridview: no built-in add/insert !?

Discussion in 'ASP .Net Web Controls' started by Rick, May 30, 2007.

  1. Rick

    Rick Guest

    Hi,

    I don't have hands on experience in ASP .NET but have been assigned to
    a web application, and I'm learning in the school of hard knocks. How
    comes GridView has no support for adding/inserting new records, when
    this is a routine task for any application? In the eighties almost any
    product already supported that (FoxPro, Clipper, etc) why are we going
    backwards? Would someone help me, please?

    a) My gridviews need to allow the user to add new records on an empty
    grid line at the end of the grid's data, not on a separate form.

    b) The button for edit an existing row needs to be outside of the grid
    (no repeated buttons on each line), but if I do that, how can I make
    the edit textboxes appear on the grid line?

    I greatly appreciate your help.

    Thanks in advance,

    Rick
     
    Rick, May 30, 2007
    #1
    1. Advertising

  2. Rick

    Phil H Guest

    On 30 May, 06:37, Rick <> wrote:
    > Hi,
    >
    > I don't have hands on experience in ASP .NET but have been assigned to
    > a web application, and I'm learning in the school of hard knocks. How
    > comes GridView has no support for adding/inserting new records, when
    > this is a routine task for any application? In the eighties almost any
    > product already supported that (FoxPro, Clipper, etc) why are we going
    > backwards? Would someone help me, please?


    That's because Web applications are not like Windows applications. The
    web application front end is being delivered via a web browser that
    can only understand W3C compliant code and whatever controls and
    behaviours the browser can support (some enhancement is possible via
    Javascript but that too has its limitations). It's not easy emulating
    major windows based (or maybe DOS) applications like those you
    mention, especially since screen updates usually require roundtrips
    between the server and client over the internet, not to mention the
    limitations due to lack of program state retention (Session variables
    state can help but time-outs can cause problems).

    >
    > a) My gridviews need to allow the user to add new records on an empty
    > grid line at the end of the grid's data, not on a separate form.


    It can be done but only with a lot of extra code to insert a blank
    record into the data table, sort the data so that it is the last
    record, find the index value and then putting the Grid into edit mode
    with the EditIndex property set to the new record index. Also be
    mindful that the index of each row being displayed is relative to it's
    position on a particular page of the grid if paging is enabled (you'll
    also need to ensure the last page of the grid is being shown).

    >
    > b) The button for edit an existing row needs to be outside of the grid
    > (no repeated buttons on each line), but if I do that, how can I make
    > the edit textboxes appear on the grid line?


    In other words how do you tell the application which record to edit,
    then either signal an update or cancel the changes.

    Again the behaviour of text boxes on a Web form are not like those on
    a Windows data grid where they can switch between display and edit
    modes. On a web form it has to be one or the other, i.e a read-only
    text on the page, or a text box.

    Sorry!
     
    Phil H, May 31, 2007
    #2
    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. Mark
    Replies:
    2
    Views:
    2,249
  2. Elmo Watson
    Replies:
    0
    Views:
    2,789
    Elmo Watson
    Aug 17, 2006
  3. jobs

    gridview add / insert button

    jobs, Jan 26, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    1,352
  4. Rick
    Replies:
    1
    Views:
    334
    Alexey Smirnov
    May 30, 2007
  5. CC
    Replies:
    1
    Views:
    246
    Scott David Daniels
    Aug 20, 2007
Loading...

Share This Page