Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Why all my Datagrid Events not firing?

Reply
Thread Tools

Why all my Datagrid Events not firing?

 
 
fred
Guest
Posts: n/a
 
      12-09-2003
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.


 
Reply With Quote
 
 
 
 
Lostinet.Web Support
Guest
Posts: n/a
 
      12-09-2003
if the command name is Edit,Cancel,Update,Delete , then ItemCommand will not
fired



"fred" <(E-Mail Removed)> 写入邮件
news:%23TYnE$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
fred
Guest
Posts: n/a
 
      12-09-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> if the command name is Edit,Cancel,Update,Delete , then ItemCommand will

not




> fired
>
>
>
> "fred" <(E-Mail Removed)> 写入邮件
> news:%23TYnE$(E-Mail Removed)...
> > 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.
> >
> >

>
>



 
Reply With Quote
 
Lostinet.Web Support
Guest
Posts: n/a
 
      12-09-2003
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" <(E-Mail Removed)> 写入邮件
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > if the command name is Edit,Cancel,Update,Delete , then ItemCommand will

> not
>
>
>
>
> > fired
> >
> >
> >
> > "fred" <(E-Mail Removed)> 写入邮件
> > news:%23TYnE$(E-Mail Removed)...
> > > 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.
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      12-16-2003
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" <(E-Mail Removed)> wrote in message
news:%23TYnE$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically adding controls with events (but events are not firing) SevDer ASP .Net 2 11-13-2007 06:33 AM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments