Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > datagrid OnCancelCommand

Reply
Thread Tools

datagrid OnCancelCommand

 
 
Brent Burkart
Guest
Posts: n/a
 
      11-17-2003
My datagrid OnCancelCommand event is not firing.

HTML
OnCancelCommand="AdminGrid_Cancel"

'Code Behind
Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
AdminGrid.EditItemIndex = -1
BindData()
End Sub

Does anyone have any clues as to why it is not firing?
Thanks,
Brent


 
Reply With Quote
 
 
 
 
Jonel Rienton
Guest
Posts: n/a
 
      11-17-2003
Brent Burkart wrote:

> My datagrid OnCancelCommand event is not firing.
>
> HTML
> OnCancelCommand="AdminGrid_Cancel"
>
> 'Code Behind
> Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> DataGridCommandEventArgs)
> AdminGrid.EditItemIndex = -1
> BindData()
> End Sub
>
> Does anyone have any clues as to why it is not firing?
> Thanks,
> Brent
>
>


Brent,

If you are using VS.Net IDE, i had quite the same experience. Try
investigating by looking at the actual declaration of the hook-events
delegation. For some reason, sometimes, the IDE is taking out this
delegation.

hth,
Jonel

 
Reply With Quote
 
 
 
 
Brent Burkart
Guest
Posts: n/a
 
      11-17-2003
Thank Jonel,

I guess I am not sure what you are telling me.

I did add the handler keyword such as the following:

Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs) Handles AdminGrid.CancelCommand

This didn't seem to do anything.

I am new to .NET. I am not sure what you mean by delegation.

Thanks for your patience.

Brent

"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
news:3FB92857.9020207@nospam_.core.com...
> Brent Burkart wrote:
>
> > My datagrid OnCancelCommand event is not firing.
> >
> > HTML
> > OnCancelCommand="AdminGrid_Cancel"
> >
> > 'Code Behind
> > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> > DataGridCommandEventArgs)
> > AdminGrid.EditItemIndex = -1
> > BindData()
> > End Sub
> >
> > Does anyone have any clues as to why it is not firing?
> > Thanks,
> > Brent
> >
> >

>
> Brent,
>
> If you are using VS.Net IDE, i had quite the same experience. Try
> investigating by looking at the actual declaration of the hook-events
> delegation. For some reason, sometimes, the IDE is taking out this
> delegation.
>
> hth,
> Jonel
>



 
Reply With Quote
 
Jonel Rienton
Guest
Posts: n/a
 
      11-17-2003
Brent,

1) are you using VS.Net? or are you using another IDE?
2) i'm more of a C# developer, so i'll try to give it a shot here

aren't you, in VB.Net, supposed to declare an event-hook handler
somewhere(Page_Load,Page_Init) like:

AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel

let me know how it goes,

Jonel


Brent Burkart wrote:

> Thank Jonel,
>
> I guess I am not sure what you are telling me.
>
> I did add the handler keyword such as the following:
>
> Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
>
> This didn't seem to do anything.
>
> I am new to .NET. I am not sure what you mean by delegation.
>
> Thanks for your patience.
>
> Brent
>
> "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> news:3FB92857.9020207@nospam_.core.com...
>
>>Brent Burkart wrote:
>>
>>
>>>My datagrid OnCancelCommand event is not firing.
>>>
>>>HTML
>>>OnCancelCommand="AdminGrid_Cancel"
>>>
>>>'Code Behind
>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>>DataGridCommandEventArgs)
>>> AdminGrid.EditItemIndex = -1
>>> BindData()
>>>End Sub
>>>
>>>Does anyone have any clues as to why it is not firing?
>>>Thanks,
>>>Brent
>>>
>>>

>>
>>Brent,
>>
>>If you are using VS.Net IDE, i had quite the same experience. Try
>>investigating by looking at the actual declaration of the hook-events
>>delegation. For some reason, sometimes, the IDE is taking out this
>>delegation.
>>
>>hth,
>>Jonel
>>

>
>
>



 
Reply With Quote
 
Brent Burkart
Guest
Posts: n/a
 
      11-17-2003
Thanks Jonel,

I am using VS.NET and you were correct in adding the AddHandler statement.
However, the event is still not firing. I appreciate your help because I am
at a loss.

Thanks,
Brent
"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
news:3FB940F6.2060004@nospam_.core.com...
> Brent,
>
> 1) are you using VS.Net? or are you using another IDE?
> 2) i'm more of a C# developer, so i'll try to give it a shot here
>
> aren't you, in VB.Net, supposed to declare an event-hook handler
> somewhere(Page_Load,Page_Init) like:
>
> AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
>
> let me know how it goes,
>
> Jonel
>
>
> Brent Burkart wrote:
>
> > Thank Jonel,
> >
> > I guess I am not sure what you are telling me.
> >
> > I did add the handler keyword such as the following:
> >
> > Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> > DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
> >
> > This didn't seem to do anything.
> >
> > I am new to .NET. I am not sure what you mean by delegation.
> >
> > Thanks for your patience.
> >
> > Brent
> >
> > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> > news:3FB92857.9020207@nospam_.core.com...
> >
> >>Brent Burkart wrote:
> >>
> >>
> >>>My datagrid OnCancelCommand event is not firing.
> >>>
> >>>HTML
> >>>OnCancelCommand="AdminGrid_Cancel"
> >>>
> >>>'Code Behind
> >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>>DataGridCommandEventArgs)
> >>> AdminGrid.EditItemIndex = -1
> >>> BindData()
> >>>End Sub
> >>>
> >>>Does anyone have any clues as to why it is not firing?
> >>>Thanks,
> >>>Brent
> >>>
> >>>
> >>
> >>Brent,
> >>
> >>If you are using VS.Net IDE, i had quite the same experience. Try
> >>investigating by looking at the actual declaration of the hook-events
> >>delegation. For some reason, sometimes, the IDE is taking out this
> >>delegation.
> >>
> >>hth,
> >>Jonel
> >>

> >
> >
> >

>
>



 
Reply With Quote
 
Jonel Rienton
Guest
Posts: n/a
 
      11-17-2003
Brent,

let's take this one step at a time, insert a Debug.WriteLine statement
in your event handler like:

'Code Behind
Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
System.Diagnostics.Debug.WriteLine("admingrid_canc el called")
AdminGrid.EditItemIndex = -1
BindData()
End Sub

then run your webapp in debug mode and look at your debug window as you
test your application.

Brent Burkart wrote:

> Thanks Jonel,
>
> I am using VS.NET and you were correct in adding the AddHandler statement.
> However, the event is still not firing. I appreciate your help because I am
> at a loss.
>
> Thanks,
> Brent
> "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> news:3FB940F6.2060004@nospam_.core.com...
>
>>Brent,
>>
>>1) are you using VS.Net? or are you using another IDE?
>>2) i'm more of a C# developer, so i'll try to give it a shot here
>>
>> aren't you, in VB.Net, supposed to declare an event-hook handler
>>somewhere(Page_Load,Page_Init) like:
>>
>>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
>>
>>let me know how it goes,
>>
>>Jonel
>>
>>
>>Brent Burkart wrote:
>>
>>
>>>Thank Jonel,
>>>
>>>I guess I am not sure what you are telling me.
>>>
>>>I did add the handler keyword such as the following:
>>>
>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
>>>
>>>This didn't seem to do anything.
>>>
>>>I am new to .NET. I am not sure what you mean by delegation.
>>>
>>>Thanks for your patience.
>>>
>>>Brent
>>>
>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
>>>news:3FB92857.9020207@nospam_.core.com...
>>>
>>>
>>>>Brent Burkart wrote:
>>>>
>>>>
>>>>
>>>>>My datagrid OnCancelCommand event is not firing.
>>>>>
>>>>>HTML
>>>>>OnCancelCommand="AdminGrid_Cancel"
>>>>>
>>>>>'Code Behind
>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>>>>DataGridCommandEventArgs)
>>>>> AdminGrid.EditItemIndex = -1
>>>>> BindData()
>>>>>End Sub
>>>>>
>>>>>Does anyone have any clues as to why it is not firing?
>>>>>Thanks,
>>>>>Brent
>>>>>
>>>>>
>>>>
>>>>Brent,
>>>>
>>>>If you are using VS.Net IDE, i had quite the same experience. Try
>>>>investigating by looking at the actual declaration of the hook-events
>>>>delegation. For some reason, sometimes, the IDE is taking out this
>>>>delegation.
>>>>
>>>>hth,
>>>>Jonel
>>>>
>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
Brent Burkart
Guest
Posts: n/a
 
      11-17-2003
Thanks Jonel,

I really appreciate your help. I do set a breakpoint and it never hits my
events. I also put the debug statement in and nothing.

I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
know if that sheds any light on anything or not.

Thanks,
Brent
"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
news:3FB94C58.4040503@nospam_.core.com...
> Brent,
>
> let's take this one step at a time, insert a Debug.WriteLine statement
> in your event handler like:
>
> 'Code Behind
> Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> DataGridCommandEventArgs)
> System.Diagnostics.Debug.WriteLine("admingrid_canc el called")
> AdminGrid.EditItemIndex = -1
> BindData()
> End Sub
>
> then run your webapp in debug mode and look at your debug window as you
> test your application.
>
> Brent Burkart wrote:
>
> > Thanks Jonel,
> >
> > I am using VS.NET and you were correct in adding the AddHandler

statement.
> > However, the event is still not firing. I appreciate your help because

I am
> > at a loss.
> >
> > Thanks,
> > Brent
> > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> > news:3FB940F6.2060004@nospam_.core.com...
> >
> >>Brent,
> >>
> >>1) are you using VS.Net? or are you using another IDE?
> >>2) i'm more of a C# developer, so i'll try to give it a shot here
> >>
> >> aren't you, in VB.Net, supposed to declare an event-hook handler
> >>somewhere(Page_Load,Page_Init) like:
> >>
> >>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
> >>
> >>let me know how it goes,
> >>
> >>Jonel
> >>
> >>
> >>Brent Burkart wrote:
> >>
> >>
> >>>Thank Jonel,
> >>>
> >>>I guess I am not sure what you are telling me.
> >>>
> >>>I did add the handler keyword such as the following:
> >>>
> >>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
> >>>
> >>>This didn't seem to do anything.
> >>>
> >>>I am new to .NET. I am not sure what you mean by delegation.
> >>>
> >>>Thanks for your patience.
> >>>
> >>>Brent
> >>>
> >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> >>>news:3FB92857.9020207@nospam_.core.com...
> >>>
> >>>
> >>>>Brent Burkart wrote:
> >>>>
> >>>>
> >>>>
> >>>>>My datagrid OnCancelCommand event is not firing.
> >>>>>
> >>>>>HTML
> >>>>>OnCancelCommand="AdminGrid_Cancel"
> >>>>>
> >>>>>'Code Behind
> >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>>>>DataGridCommandEventArgs)
> >>>>> AdminGrid.EditItemIndex = -1
> >>>>> BindData()
> >>>>>End Sub
> >>>>>
> >>>>>Does anyone have any clues as to why it is not firing?
> >>>>>Thanks,
> >>>>>Brent
> >>>>>
> >>>>>
> >>>>
> >>>>Brent,
> >>>>
> >>>>If you are using VS.Net IDE, i had quite the same experience. Try
> >>>>investigating by looking at the actual declaration of the hook-events
> >>>>delegation. For some reason, sometimes, the IDE is taking out this
> >>>>delegation.
> >>>>
> >>>>hth,
> >>>>Jonel
> >>>>
> >>>
> >>>
> >>>
> >>

> >
> >

>



 
Reply With Quote
 
Jonel Rienton
Guest
Posts: n/a
 
      11-18-2003
Brent,

are you hooking up the events manually or are you letting VS.Net IDE do
it for you? if the latter, check to make sure that the IDE is indeed
hooking up the events and the eventhandlers.

Jonel

[1] you can send me a snippet of your code offline if you'd like so i
can take a look at it.

Brent Burkart wrote:

> Thanks Jonel,
>
> I really appreciate your help. I do set a breakpoint and it never hits my
> events. I also put the debug statement in and nothing.
>
> I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
> know if that sheds any light on anything or not.
>
> Thanks,
> Brent
> "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> news:3FB94C58.4040503@nospam_.core.com...
>
>>Brent,
>>
>>let's take this one step at a time, insert a Debug.WriteLine statement
>>in your event handler like:
>>
>>'Code Behind
>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>DataGridCommandEventArgs)
>> System.Diagnostics.Debug.WriteLine("admingrid_canc el called")
>> AdminGrid.EditItemIndex = -1
>> BindData()
>>End Sub
>>
>>then run your webapp in debug mode and look at your debug window as you
>>test your application.
>>
>>Brent Burkart wrote:
>>
>>
>>>Thanks Jonel,
>>>
>>>I am using VS.NET and you were correct in adding the AddHandler

>
> statement.
>
>>>However, the event is still not firing. I appreciate your help because

>
> I am
>
>>>at a loss.
>>>
>>>Thanks,
>>>Brent
>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
>>>news:3FB940F6.2060004@nospam_.core.com...
>>>
>>>
>>>>Brent,
>>>>
>>>>1) are you using VS.Net? or are you using another IDE?
>>>>2) i'm more of a C# developer, so i'll try to give it a shot here
>>>>
>>>> aren't you, in VB.Net, supposed to declare an event-hook handler
>>>>somewhere(Page_Load,Page_Init) like:
>>>>
>>>>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
>>>>
>>>>let me know how it goes,
>>>>
>>>>Jonel
>>>>
>>>>
>>>>Brent Burkart wrote:
>>>>
>>>>
>>>>
>>>>>Thank Jonel,
>>>>>
>>>>>I guess I am not sure what you are telling me.
>>>>>
>>>>>I did add the handler keyword such as the following:
>>>>>
>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>>>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
>>>>>
>>>>>This didn't seem to do anything.
>>>>>
>>>>>I am new to .NET. I am not sure what you mean by delegation.
>>>>>
>>>>>Thanks for your patience.
>>>>>
>>>>>Brent
>>>>>
>>>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
>>>>>news:3FB92857.9020207@nospam_.core.com...
>>>>>
>>>>>
>>>>>
>>>>>>Brent Burkart wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>My datagrid OnCancelCommand event is not firing.
>>>>>>>
>>>>>>>HTML
>>>>>>>OnCancelCommand="AdminGrid_Cancel"
>>>>>>>
>>>>>>>'Code Behind
>>>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
>>>>>>>DataGridCommandEventArgs)
>>>>>>> AdminGrid.EditItemIndex = -1
>>>>>>> BindData()
>>>>>>>End Sub
>>>>>>>
>>>>>>>Does anyone have any clues as to why it is not firing?
>>>>>>>Thanks,
>>>>>>>Brent
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>Brent,
>>>>>>
>>>>>>If you are using VS.Net IDE, i had quite the same experience. Try
>>>>>>investigating by looking at the actual declaration of the hook-events
>>>>>>delegation. For some reason, sometimes, the IDE is taking out this
>>>>>>delegation.
>>>>>>
>>>>>>hth,
>>>>>>Jonel
>>>>>>
>>>>>
>>>>>
>>>>>
>>>

>
>


 
Reply With Quote
 
Brent Burkart
Guest
Posts: n/a
 
      11-18-2003
Jonel,

Here is the code. Thanks so much for your help

HTML


<form runat="server">

<aspataGrid runat="server" id="AdminGrid" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" Width="742px" Height="231px" DataKeyField="ProductID" AutoGenerateColumns="False" OnEditCommand="AdminGrid_EditCommand" OnCancelCommand="AdminGrid_CancelCommand" OnUpdateCommand="AdminGrid_UpdateCommand">

<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>

<ItemStyle ForeColor="#000066"></ItemStyle>

<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>

<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>

<Columns>

<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>

<asp:BoundColumn DataField="ModelName" HeaderText="Product Name"></asp:BoundColumn>

<asp:BoundColumn DataField="ModelNumber" HeaderText="Product Number"></asp:BoundColumn>

<asp:BoundColumn DataField="ProductImage" HeaderText="Product Image"></asp:BoundColumn>

<asp:BoundColumn DataField="itemcount" HeaderText="Item Count">

<HeaderStyle Width="35px"></HeaderStyle>

</asp:BoundColumn>

<asp:HyperLinkColumn Text="Level Setup" DataNavigateUrlField="ProductID" NavigateUrl="AdminPrice.aspx?id={0}">

<HeaderStyle Width="35px"></HeaderStyle>

</asp:HyperLinkColumn>

<asp:BoundColumn DataField="description" HeaderText="Description">

<HeaderStyle Width="150px"></HeaderStyle>

</asp:BoundColumn>

</Columns>

<PagerStyle HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>

</aspataGrid></form>



'Code Behind


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not Page.IsPostBack Then

BindData()

End If

AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_CancelCommand

AddHandler AdminGrid.UpdateCommand, AddressOf AdminGrid_UpdateCommand

End Sub

Sub BindData()

Dim CategoryID As Integer = CInt(Request.Params("categoryid"))



' Obtain Product Details

Dim products As ProductsDB = New ProductsDB()





' Databind Gridcontrol with Shopping Cart Items

AdminGrid.DataSource = products.GetCompleteProductDetails(CategoryID)

AdminGrid.DataBind()





End Sub

Private Sub AdminGrid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AdminGrid.SelectedIndexChanged



End Sub

Sub AdminGrid_EditCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

AdminGrid.EditItemIndex = e.Item.ItemIndex

BindData()

End Sub

Sub AdminGrid_CancelCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles AdminGrid.CancelCommand

System.Diagnostics.Debug.WriteLine("admingrid_canc el called")

AdminGrid.EditItemIndex = -1

BindData()

End Sub



Sub AdminGrid_UpdateCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles AdminGrid.UpdateCommand



Dim product As ASPNET.StarterKit.Commerce.ProductsDB = New ASPNET.StarterKit.Commerce.ProductsDB()

'Iterate through all rows within datagrid



Dim i As Integer

For i = 0 To AdminGrid.Items.Count - 1

Dim ProductIdTxt As TextBox = CType(AdminGrid.Items(i).FindControl("productid"), TextBox)

Dim ModelNumberTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ModelNumber" ), TextBox)

Dim ModelNameTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ModelName"), TextBox)

Dim ProductImageTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ProductImage "), TextBox)

Dim DescriptionTxt As TextBox = CType(AdminGrid.Items(i).FindControl("Description" ), TextBox)

Dim ItemCountTxt As TextBox = CType(AdminGrid.Items(i).FindControl("ItemCount"), TextBox)

Dim ProductId As Integer

Dim ModelNumber As String

Dim ModelName As String

Dim ProductImage As String

Dim Description As String

Dim ItemCount As Integer



product.UpdateDetails(ProductId, ModelNumber, ModelName, ProductImage, Description, ItemCount)



AdminGrid.EditItemIndex = -1

BindData()

Next

End Sub

"Jonel Rienton" <csharp@nospam_.core.com> wrote in message news:3FB98ECA.1070309@nospam_.core.com...

> Brent,
>
> are you hooking up the events manually or are you letting VS.Net IDE do
> it for you? if the latter, check to make sure that the IDE is indeed
> hooking up the events and the eventhandlers.
>
> Jonel
>
> [1] you can send me a snippet of your code offline if you'd like so i
> can take a look at it.
>
> Brent Burkart wrote:
>
> > Thanks Jonel,
> >
> > I really appreciate your help. I do set a breakpoint and it never hits my
> > events. I also put the debug statement in and nothing.
> >
> > I should tell you my AdminGrid_UpdateCommand will not fire either. I don't
> > know if that sheds any light on anything or not.
> >
> > Thanks,
> > Brent
> > "Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> > news:3FB94C58.4040503@nospam_.core.com...
> >
> >>Brent,
> >>
> >>let's take this one step at a time, insert a Debug.WriteLine statement
> >>in your event handler like:
> >>
> >>'Code Behind
> >>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>DataGridCommandEventArgs)
> >> System.Diagnostics.Debug.WriteLine("admingrid_canc el called")
> >> AdminGrid.EditItemIndex = -1
> >> BindData()
> >>End Sub
> >>
> >>then run your webapp in debug mode and look at your debug window as you
> >>test your application.
> >>
> >>Brent Burkart wrote:
> >>
> >>
> >>>Thanks Jonel,
> >>>
> >>>I am using VS.NET and you were correct in adding the AddHandler

> >
> > statement.
> >
> >>>However, the event is still not firing. I appreciate your help because

> >
> > I am
> >
> >>>at a loss.
> >>>
> >>>Thanks,
> >>>Brent
> >>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> >>>news:3FB940F6.2060004@nospam_.core.com...
> >>>
> >>>
> >>>>Brent,
> >>>>
> >>>>1) are you using VS.Net? or are you using another IDE?
> >>>>2) i'm more of a C# developer, so i'll try to give it a shot here
> >>>>
> >>>> aren't you, in VB.Net, supposed to declare an event-hook handler
> >>>>somewhere(Page_Load,Page_Init) like:
> >>>>
> >>>>AddHandler AdminGrid.CancelCommand, AddressOf AdminGrid_Cancel
> >>>>
> >>>>let me know how it goes,
> >>>>
> >>>>Jonel
> >>>>
> >>>>
> >>>>Brent Burkart wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Thank Jonel,
> >>>>>
> >>>>>I guess I am not sure what you are telling me.
> >>>>>
> >>>>>I did add the handler keyword such as the following:
> >>>>>
> >>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>>>>DataGridCommandEventArgs) Handles AdminGrid.CancelCommand
> >>>>>
> >>>>>This didn't seem to do anything.
> >>>>>
> >>>>>I am new to .NET. I am not sure what you mean by delegation.
> >>>>>
> >>>>>Thanks for your patience.
> >>>>>
> >>>>>Brent
> >>>>>
> >>>>>"Jonel Rienton" <csharp@nospam_.core.com> wrote in message
> >>>>>news:3FB92857.9020207@nospam_.core.com...
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Brent Burkart wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>My datagrid OnCancelCommand event is not firing.
> >>>>>>>
> >>>>>>>HTML
> >>>>>>>OnCancelCommand="AdminGrid_Cancel"
> >>>>>>>
> >>>>>>>'Code Behind
> >>>>>>>Sub AdminGrid_Cancel(ByVal sender As Object, ByVal e As
> >>>>>>>DataGridCommandEventArgs)
> >>>>>>> AdminGrid.EditItemIndex = -1
> >>>>>>> BindData()
> >>>>>>>End Sub
> >>>>>>>
> >>>>>>>Does anyone have any clues as to why it is not firing?
> >>>>>>>Thanks,
> >>>>>>>Brent
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>Brent,
> >>>>>>
> >>>>>>If you are using VS.Net IDE, i had quite the same experience. Try
> >>>>>>investigating by looking at the actual declaration of the hook-events
> >>>>>>delegation. For some reason, sometimes, the IDE is taking out this
> >>>>>>delegation.
> >>>>>>
> >>>>>>hth,
> >>>>>>Jonel
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>

> >
> >

>

 
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
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
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