Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP.Net question

  • 14-10-2005 03: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