Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.Net question

Options
  • 14-10-2005 3:45pm
    #1
    Closed Accounts Posts: 413 ✭✭


    Hi there,

    can anyone tell me why the procedure 'dgDisplayCust_EditCommand' is not firing in the code below, its a procedure to allow a user to edit data in a datagrid.

    thanks guys




    in this code
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">



    <asp:datagrid id="DGdisplayCust" style="Z-INDEX: 101; LEFT: 88px; POSITION: absolute; TOP: 128px"
    runat="server" Width="456px" Height="160px" ShowFooter="True" DataKeyField="iIdentity" OnEditCommand="dgDisplayCust_EditCommand "
    OnUpdateCommand="DGdisplayCust_UpdateCommand" OnCancelCommand="DGdisplayCust_CancelCommand"
    BackColor="White" BorderStyle="None" BorderColor="#CC9966" BorderWidth="1px" CellPadding="4"
    AutoGenerateColumns="False">
    <SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
    <ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle>
    <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>





    <Columns>
    <asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
    <asp:BoundColumn DataField="iIdentity" ReadOnly="True" HeaderText="iIdentity"></asp:BoundColumn>
    <asp:BoundColumn DataField="vcFirstName" HeaderText="vcFirstName"></asp:BoundColumn>
    </Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
    </asp:datagrid>
    <asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 200px; POSITION: absolute; TOP: 64px" runat="server"
    Width="168px" Height="24px">Label</asp:Label></form>
    </body>
    </HTML>



Comments

  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    is there an event handler in your code to run that section of code when the "edit" button is clicked?


  • Closed Accounts Posts: 413 ✭✭spooydermot


    is there an event handler in your code to run that section of code when the "edit" button is clicked?

    there is indeed, it's called: dgDisplayCust_EditCommand

    Now that I look at the code i posted there is a space character in the HTML
    i.e:
    "dgDisplayCust_EditCommand "

    I wonder if that might be part of the problem, I must check that when I get back to the code in a couple of days.

    Thanks for the response Mutant_Fruit! any other suggestions are welcome


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    i mean something like this line of code:

    this.btnAbort.Click += new System.EventHandler(this.btnAbort_Click);

    This means that when the button is "clicked" the code corresponding to the "click" event gets fired.

    Do you have a line similar to that for your edit button?


Advertisement