edit button in datagrid

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default edit button in datagrid

    I want to add a button within an Item Template column that will set the edit
    mode for the current item in the grid. can anyone tell me how to do it
    without adding an edit command column?

    Thanks!


    Matt Tapia Guest

  2. Similar Questions and Discussions

    1. Would like to load a datagrid already in edit mode instead of having the user click the edit button
      Now my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode. I would like to: 1) possilby load the page already...
    2. Trigger Datagrid Edit From Command Button
      Hey all, I was wanting to know if this was possible. I have a Datagrid with inline editing capabilites and all that jazz, it all works. What I...
    3. Adding javascript function to update button in datagrid edit row
      I'd like to run a javascript function when you click the update button on an edit row, but I've no idea how I'd set it. Can't find any examples,...
    4. DataGrid contains no data after postback of edit button click...
      This is specifically what is going on in my application:...
    5. Edit button in datagrid doesn't work!?
      Hi, I have this piece of code: <asp:datagrid id="dgRezervirano" runat="server" CssClass="rezervacije" AutoGenerateColumns="false"...
  3. #2

    Default Re: edit button in datagrid

    > I want to add a button within an Item Template column that will set the
    edit
    > mode for the current item in the grid. can anyone tell me how to do it
    > without adding an edit command column?
    Setting the edit item is as straightforward as datagrid.EditItemIndex =
    <whatever value you want>

    So, in essence, you just need a button to post back, and then handle this
    post back in an event handler that sets the EditItemIndex. Using an edit
    command grid makes this easier, because you can then trap the EditCommand
    event handler and use the DataGridCommandEventArgs e.Item.ItemIndex to get
    this value. But once you roll a mechanism to determine what row should be
    edited, it's just a single line of code to set this row into edit mode.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    --


    Chris Jackson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139