|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CancelCommand Not Firing!I have an asp:DataGrid control with EnableViewState=False. I am calling
DataBind on both the non-postback and the postback. I am persisting the state of the grid myself and restoring the state (selectedItem, editItem, sortCommand, etc.). Everything is working just fine EXCEPT the CancelCommand event is not firing. All the other events ARE firing. Any ideas? Show your code please.
Elton Wang elton_w***@hotmail.com >-----Original Message----- EnableViewState=False. I am calling >I have an asp:DataGrid control with Show quoteHide quote >DataBind on both the non-postback and the postback. I am persisting the >state of the grid myself and restoring the state (selectedItem, editItem, >sortCommand, etc.). Everything is working just fine EXCEPT the >CancelCommand event is not firing. All the other events ARE firing. > >Any ideas? > > > >. > Private Sub dg_CancelCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg.CancelCommand dg.EditItemIndex = -1 dg.DataBind() End Sub SortCommand event fires, PageIndexChanged event fires, SelectedIndexChanged event fires, EditCommand fires, CancelCommand does not but it does have the correct Handles clause. Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:032d01c50fde$ed6235c0$a501280a@phx.gbl... > Show your code please. > > Elton Wang > elton_w***@hotmail.com > >>-----Original Message----- >>I have an asp:DataGrid control with > EnableViewState=False. I am calling >>DataBind on both the non-postback and the postback. I am > persisting the >>state of the grid myself and restoring the state > (selectedItem, editItem, >>sortCommand, etc.). Everything is working just fine > EXCEPT the >>CancelCommand event is not firing. All the other events > ARE firing. >> >>Any ideas? >> >> >> >>. >> Unfortunately once you disable ViewState of the datagrid,
it seems the system can't correctly transfer link button name, no matter you click Edit, or Cancel, or Update button, it only gives Edit. Hence it only fires Edit (selectedItem, SortCommand are not affected). HTH, Elton Wang elton_w***@hotmail.com >-----Original Message----- EnableViewState=False. I am calling >I have an asp:DataGrid control with Show quoteHide quote >DataBind on both the non-postback and the postback. I am persisting the >state of the grid myself and restoring the state (selectedItem, editItem, >sortCommand, etc.). Everything is working just fine EXCEPT the >CancelCommand event is not firing. All the other events ARE firing. > >Any ideas? > > > >. > I'm afraid that analysis is incorrect. I'm not using LinkButton controls
anyway and (as I mentioned) all other events are firing properly except the CancelCommand event. Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:151601c51043$dcc52cd0$a401280a@phx.gbl... > Unfortunately once you disable ViewState of the datagrid, > it seems the system can't correctly transfer link button > name, no matter you click Edit, or Cancel, or Update > button, it only gives Edit. Hence it only fires Edit > (selectedItem, SortCommand are not affected). > > HTH, > > Elton Wang > elton_w***@hotmail.com > > >>-----Original Message----- >>I have an asp:DataGrid control with > EnableViewState=False. I am calling >>DataBind on both the non-postback and the postback. I am > persisting the >>state of the grid myself and restoring the state > (selectedItem, editItem, >>sortCommand, etc.). Everything is working just fine > EXCEPT the >>CancelCommand event is not firing. All the other events > ARE firing. >> >>Any ideas? >> >> >> >>. >> Although you aren't explicitly using linkButton, you are
actually using it when you are using EditCommandColumn. Why don't you create ItemCommand event and debug into the event to see what happens? Elton Wang >-----Original Message----- properly except the >I'm afraid that analysis is incorrect. I'm not using LinkButton controls >anyway and (as I mentioned) all other events are firing Show quoteHide quote >CancelCommand event. > >"Elton Wang" <anonym***@discussions.microsoft.com> wrote in message >news:151601c51043$dcc52cd0$a401280a@phx.gbl... >> Unfortunately once you disable ViewState of the datagrid, >> it seems the system can't correctly transfer link button >> name, no matter you click Edit, or Cancel, or Update >> button, it only gives Edit. Hence it only fires Edit >> (selectedItem, SortCommand are not affected). >> >> HTH, >> >> Elton Wang >> elton_w***@hotmail.com >> >> >>>-----Original Message----- >>>I have an asp:DataGrid control with >> EnableViewState=False. I am calling >>>DataBind on both the non-postback and the postback. I am >> persisting the >>>state of the grid myself and restoring the state >> (selectedItem, editItem, >>>sortCommand, etc.). Everything is working just fine >> EXCEPT the >>>CancelCommand event is not firing. All the other events >> ARE firing. >>> >>>Any ideas? >>> >>> >>> >>>. >>> > > >. > I really don't think the linkButton is being used as I have configured the
grid to use a Web Forms Button instead of a linkButton. I could debug the ItemCreated event, but that would tell me what I already know...that the CancelCommand is not firing. I'm not trying to diagnose...I have the diagnosis, what I'm looking for is the cure. Thank you anyway. Show quoteHide quote "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:292901c511e5$f8320da0$a601280a@phx.gbl... > Although you aren't explicitly using linkButton, you are > actually using it when you are using EditCommandColumn. > Why don't you create ItemCommand event and debug into the > event to see what happens? > > Elton Wang > >>-----Original Message----- >>I'm afraid that analysis is incorrect. I'm not using > LinkButton controls >>anyway and (as I mentioned) all other events are firing > properly except the >>CancelCommand event. >> >>"Elton Wang" <anonym***@discussions.microsoft.com> wrote > in message >>news:151601c51043$dcc52cd0$a401280a@phx.gbl... >>> Unfortunately once you disable ViewState of the > datagrid, >>> it seems the system can't correctly transfer link button >>> name, no matter you click Edit, or Cancel, or Update >>> button, it only gives Edit. Hence it only fires Edit >>> (selectedItem, SortCommand are not affected). >>> >>> HTH, >>> >>> Elton Wang >>> elton_w***@hotmail.com >>> >>> >>>>-----Original Message----- >>>>I have an asp:DataGrid control with >>> EnableViewState=False. I am calling >>>>DataBind on both the non-postback and the postback. I > am >>> persisting the >>>>state of the grid myself and restoring the state >>> (selectedItem, editItem, >>>>sortCommand, etc.). Everything is working just fine >>> EXCEPT the >>>>CancelCommand event is not firing. All the other events >>> ARE firing. >>>> >>>>Any ideas? >>>> >>>> >>>> >>>>. >>>> >> >> >>. >> "Elton Wang" <anonym***@discussions.microsoft.com> wrote in message news:<151601c51043$dcc52cd0$a401280a@phx.gbl>... I'm having a similar problem and just noticed what you mentioned. Is> Unfortunately once you disable ViewState of the datagrid, > it seems the system can't correctly transfer link button > name, no matter you click Edit, or Cancel, or Update > button, it only gives Edit. Hence it only fires Edit > (selectedItem, SortCommand are not affected). there a known work around for this? When I enable ViewState for my dataGrid, I get the "Failed to load viewState" when any action is done on the first row of my datagrid. JUST the first row. I can modify and manipulate any other row and I won't get the "Failed to load viewState" error. I'm not dynamically adding/deleting any controls either. What are my options? Thanks
Datagrid ... pain .... HELP!
Problem with datagrid update problem updating in datagrid ?? How to refresh a parent grid? DataTable consisting of 2 other DataTables Sorting underlying data Dynamically adding DataGrid columns datagrid(master) with a datalist(detail) Hyperlink Column Event Handler... Datagrid Footer now showing up correctly |
|||||||||||||||||||||||