Why all my Datagrid Events not firing?

F

fred

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.
 
L

Lostinet.Web Support

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

fred

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
 
L

Lostinet.Web Support

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
 
K

Ken Cox [Microsoft MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top