Dynamically created Datgrid will not enter Edit Mode!

Discussion in 'ASP .Net Web Controls' started by Mike, Jan 13, 2004.

  1. Mike

    Mike Guest

    Hi,

    I am having problems with my program, the problem is it will not put
    the datagrid into edit mode.

    The .aspx page has the following code in it : -

    <asp:datagrid id="DataGrid2" runat="server"
    OnEditCommand="DEDR_Edit2"></asp:datagrid>

    The columns for the datagrid are created dynamically (code for this on
    request) including the column giving the user the option to Edit the
    grid. When the user clicks "edit" the page refreshes i.e post backs
    but the user cannot edit the data, no text boxs. The EditTemplate is
    not activated.

    Using Visual Studio I have put a break point in the function which is
    in the .aspx.cs file.

    protected void DEDR_Edit2(object sender, DataGridCommandEventArgs e)
    {
    DataGrid2.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex);
    DataGrid2.DataSource = dsRota.Tables["dtRota_Display"];
    DataGrid2.DataBind();
    }

    and it does not execute this code. This explains why there it does
    not go into edit mode. But why is it not going into this function? If
    I exclude it from the code, the compiler has a moan about not finding
    DEDR_Edit2! So it knows it is there!

    Please help!

    Mike
     
    Mike, Jan 13, 2004
    #1
    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. Mike
    Replies:
    0
    Views:
    393
  2. Iain
    Replies:
    0
    Views:
    280
  3. msimmons
    Replies:
    0
    Views:
    497
    msimmons
    Jul 16, 2009
  4. GP

    How to add columns dynamically using Datgrid in C#

    GP, Aug 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    124
  5. HopfZ
    Replies:
    0
    Views:
    576
    HopfZ
    Aug 28, 2006
Loading...

Share This Page