DG Start wtih Row 0 in Edit Mode?

Discussion in 'ASP .Net Datagrid Control' started by Scott Murray, Aug 1, 2003.

  1. Scott Murray

    Scott Murray Guest

    My "Add a Record" button is outside of the DG.

    When it's pushed, it adds a new row at the top of the DG. It add the row in
    normal display mode, forcing the user to hit the Edit Button to enter data.

    I'd rather have the DG display the new row already in Edit mode (with
    Textboxes).

    I've experimented with putting:

    dg_line_items.EditItemIndex = 0

    in different places, but have not succeeded.

    Any ideas?

    TIA,
    Scott Murray
     
    Scott Murray, Aug 1, 2003
    #1
    1. Advertising

  2. Scott Murray

    JLeary Guest

    Not sure if this is related, but I am trying to do something similar. My
    'Add' button works fine if there are already rows in the datagrid, but if it
    is the first, it is failing. I was trying to code functionality to auto
    populate the first row of the grid if the datasource had zero records.



    "Scott Murray" <> wrote in message
    news:...
    > My "Add a Record" button is outside of the DG.
    >
    > When it's pushed, it adds a new row at the top of the DG. It add the row

    in
    > normal display mode, forcing the user to hit the Edit Button to enter

    data.
    >
    > I'd rather have the DG display the new row already in Edit mode (with
    > Textboxes).
    >
    > I've experimented with putting:
    >
    > dg_line_items.EditItemIndex = 0
    >
    > in different places, but have not succeeded.
    >
    > Any ideas?
    >
    > TIA,
    > Scott Murray
    >
    >
     
    JLeary, Aug 1, 2003
    #2
    1. Advertising

  3. Scott Murray

    Scott Murray Guest

    My DG works fine, it's just a convenience for the user to have the new row
    already in edit mode.

    When I try to set the EditItemIndex = 0, I get an Failed to load viewstate
    error.





    "Scott Murray" <> wrote in message
    news:...
    > My "Add a Record" button is outside of the DG.
    >
    > When it's pushed, it adds a new row at the top of the DG. It add the row

    in
    > normal display mode, forcing the user to hit the Edit Button to enter

    data.
    >
    > I'd rather have the DG display the new row already in Edit mode (with
    > Textboxes).
    >
    > I've experimented with putting:
    >
    > dg_line_items.EditItemIndex = 0
    >
    > in different places, but have not succeeded.
    >
    > Any ideas?
    >
    > TIA,
    > Scott Murray
    >
    >
     
    Scott Murray, Aug 1, 2003
    #3
  4. Scott Murray

    Scott Murray Guest

    Solved it....

    I was not performing a dg.databind after setting the EditItemIndex = 0.

    sorry...i learned to read in the first grade but sometimes forget to do it.




    "Scott Murray" <> wrote in message
    news:...
    > My "Add a Record" button is outside of the DG.
    >
    > When it's pushed, it adds a new row at the top of the DG. It add the row

    in
    > normal display mode, forcing the user to hit the Edit Button to enter

    data.
    >
    > I'd rather have the DG display the new row already in Edit mode (with
    > Textboxes).
    >
    > I've experimented with putting:
    >
    > dg_line_items.EditItemIndex = 0
    >
    > in different places, but have not succeeded.
    >
    > Any ideas?
    >
    > TIA,
    > Scott Murray
    >
    >
     
    Scott Murray, Aug 1, 2003
    #4
    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. avinashrk
    Replies:
    10
    Views:
    4,787
    Andrew Thompson
    Dec 14, 2004
  2. chris patton

    the problem wtih cgi

    chris patton, May 28, 2005, in forum: Python
    Replies:
    3
    Views:
    306
    Ivan Van Laningham
    May 29, 2005
  3. pizza
    Replies:
    1
    Views:
    546
    Eliyahu Goldin
    Mar 8, 2007
  4. Jon Slaughter

    triggering events wtih css

    Jon Slaughter, Mar 23, 2007, in forum: HTML
    Replies:
    8
    Views:
    753
    Ben C
    Mar 26, 2007
  5. Barrow H Kwan

    rbx wtih Apache 2

    Barrow H Kwan, Jun 30, 2003, in forum: Ruby
    Replies:
    1
    Views:
    121
    John Feezell
    Jun 30, 2003
Loading...

Share This Page