Why all my Datagrid Events not firing?

Discussion in 'ASP .Net Datagrid Control' started by fred, Dec 9, 2003.

  1. fred

    fred Guest

    I have created a datagrid on an ASP.Net form, When I try to capture any of
    the "Command" events e.g. (ItemCommand) the event does not fire. I have
    tried adding all the possible buttons and have tried all the events and the
    events are not executed.
    I used the "Property builder" to add the relevant command columns to the
    grid, The grid displayed the button / link but it does not fire the code whn
    the button is pressed, the screen just refreshes.
    fred, Dec 9, 2003
    #1
    1. Advertising

  2. if the command name is Edit,Cancel,Update,Delete , then ItemCommand will not
    fired



    "fred" <> дÈëÓʼþ
    news:%23TYnE$...
    > I have created a datagrid on an ASP.Net form, When I try to capture any of
    > the "Command" events e.g. (ItemCommand) the event does not fire. I have
    > tried adding all the possible buttons and have tried all the events and

    the
    > events are not executed.
    > I used the "Property builder" to add the relevant command columns to the
    > grid, The grid displayed the button / link but it does not fire the code

    whn
    > the button is pressed, the screen just refreshes.
    >
    >
    Lostinet.Web Support, Dec 9, 2003
    #2
    1. Advertising

  3. fred

    fred Guest

    Maby you didnt understand ... OK Let me use this example. the EDIT comand
    doesnt fire the code below the page refreshes but te code does not execute.
    Any help would be greatly appreciated.

    Private Sub grdResults_EditCommand(ByVal source As Object, ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
    grdResults.EditCommand

    Me.TextBox1.Text = "DDSSD"

    End Sub



    I have even tried to map it like this using ASPX :

    <asp:datagrid id="grdResults" style="Z-INDEX: 112; LEFT: 12px; POSITION:
    absolute; TOP: 145px"
    runat="server" Height="30px" Width="673px" PageSize="35"
    EnableViewState="False" AutoGenerateColumns="False"
    OnEditCommand="EditDataGridLine">

    and this event hadler in the aspx.vb file:




    Public Sub EditDataGridLine(ByVal source As Object, ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs)

    Me.TextBox1.Text = "DDSSD"

    End Sub



    even tried this event

    Public Sub EditDataGridLine(ByVal source As Object, ByVal e As
    System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
    grdResults.EditCommand

    Me.TextBox1.Text = "DDSSD"

    End Sub


    "Lostinet.Web Support" <> wrote in message
    news:%...
    > if the command name is Edit,Cancel,Update,Delete , then ItemCommand will

    not




    > fired
    >
    >
    >
    > "fred" <> дÈëÓʼþ
    > news:%23TYnE$...
    > > I have created a datagrid on an ASP.Net form, When I try to capture any

    of
    > > the "Command" events e.g. (ItemCommand) the event does not fire. I have
    > > tried adding all the possible buttons and have tried all the events and

    > the
    > > events are not executed.
    > > I used the "Property builder" to add the relevant command columns to the
    > > grid, The grid displayed the button / link but it does not fire the code

    > whn
    > > the button is pressed, the screen just refreshes.
    > >
    > >

    >
    >
    fred, Dec 9, 2003
    #3
  4. when did you bind the datagrid ?

    if you bind the grid every page_load , any event of the grid will now be
    fired

    --
    http://www.lostinet.com/
    Lostinet.Web Controls&Components help you to build better Asp.Net
    CustomerControl&UserControl&Application.
    ControlHelper&HelperElement for MessageBox&Dialog
    ComboBox,ComboCalendar,SmartIframe
    Remote Asp.Net Execution

    "fred" <> дÈëÓʼþ
    news:...
    > Maby you didnt understand ... OK Let me use this example. the EDIT comand
    > doesnt fire the code below the page refreshes but te code does not

    execute.
    > Any help would be greatly appreciated.
    >
    > Private Sub grdResults_EditCommand(ByVal source As Object, ByVal e As
    > System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
    > grdResults.EditCommand
    >
    > Me.TextBox1.Text = "DDSSD"
    >
    > End Sub
    >
    >
    >
    > I have even tried to map it like this using ASPX :
    >
    > <asp:datagrid id="grdResults" style="Z-INDEX: 112; LEFT: 12px; POSITION:
    > absolute; TOP: 145px"
    > runat="server" Height="30px" Width="673px" PageSize="35"
    > EnableViewState="False" AutoGenerateColumns="False"
    > OnEditCommand="EditDataGridLine">
    >
    > and this event hadler in the aspx.vb file:
    >
    >
    >
    >
    > Public Sub EditDataGridLine(ByVal source As Object, ByVal e As
    > System.Web.UI.WebControls.DataGridCommandEventArgs)
    >
    > Me.TextBox1.Text = "DDSSD"
    >
    > End Sub
    >
    >
    >
    > even tried this event
    >
    > Public Sub EditDataGridLine(ByVal source As Object, ByVal e As
    > System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
    > grdResults.EditCommand
    >
    > Me.TextBox1.Text = "DDSSD"
    >
    > End Sub
    >
    >
    > "Lostinet.Web Support" <> wrote in message
    > news:%...
    > > if the command name is Edit,Cancel,Update,Delete , then ItemCommand will

    > not
    >
    >
    >
    >
    > > fired
    > >
    > >
    > >
    > > "fred" <> дÈëÓʼþ
    > > news:%23TYnE$...
    > > > I have created a datagrid on an ASP.Net form, When I try to capture

    any
    > of
    > > > the "Command" events e.g. (ItemCommand) the event does not fire. I

    have
    > > > tried adding all the possible buttons and have tried all the events

    and
    > > the
    > > > events are not executed.
    > > > I used the "Property builder" to add the relevant command columns to

    the
    > > > grid, The grid displayed the button / link but it does not fire the

    code
    > > whn
    > > > the button is pressed, the screen just refreshes.
    > > >
    > > >

    > >
    > >

    >
    >
    Lostinet.Web Support, Dec 9, 2003
    #4
  5. Fred,

    Did you check whether the Handles clause still exists in the subroutine that
    handles the events? I've had cases where "Handles" has mysteriously
    disappeared.

    "fred" <> wrote in message
    news:%23TYnE$...
    > I have created a datagrid on an ASP.Net form, When I try to capture any of
    > the "Command" events e.g. (ItemCommand) the event does not fire. I have
    > tried adding all the possible buttons and have tried all the events and

    the
    > events are not executed.
    > I used the "Property builder" to add the relevant command columns to the
    > grid, The grid displayed the button / link but it does not fire the code

    whn
    > the button is pressed, the screen just refreshes.
    >
    >
    Ken Cox [Microsoft MVP], Dec 16, 2003
    #5
    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. Rick
    Replies:
    1
    Views:
    458
    Richard Ryerson
    Feb 2, 2004
  2. Richard Ryerson
    Replies:
    0
    Views:
    2,609
    Richard Ryerson
    Jan 28, 2004
  3. Slim
    Replies:
    0
    Views:
    300
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,740
    Smokey Grindel
    Dec 2, 2006
  5. SevDer
    Replies:
    2
    Views:
    1,285
    Walter Wang [MSFT]
    Nov 13, 2007
Loading...

Share This Page