Delete row from Radgrid and refresh page
up vote
0
down vote
favorite
I have looked all over SO for an answer, but my case seems to be a bit different than the ones posted. I have a Radgrid (Shopping Cart) on my form along with other components (order summary, for example). I want to be able to delete a row from the radgrid and refresh order summary.
What I have tried so far:
- Used Radgrid's ItemCommand with a button to delete row. This deletes
the row just fine but does not refresh order summary. - Used a button's 'onclick' property to delete row and refresh order summary. This does not actually save the updated radgrid (with
the row removed). - Implemented Step 1 with a LinkButton. Same issue.
- Used a button's onclick property to then call ItemCommand and delete the row. This deletes the row but does not refresh summary.
I am fairly new to VB, and what I think is happening is when row is deleted using ItemCommand, it's updating the radgrid, but the form is not submitting. Shouldn't button_onclick handle that?
What am I doing wrong? Any help/suggestion would be highly appreciated!
Edit:
Here is my .aspx code:
<asp:LinkButton ID="lnkRemove" OnClick="lnkRemove_Click" OnCommand="CommandEventHandler" CommandName="Delete" runat="server" Text="Remove" />
And here's my codebehind:
Protected Sub lnkRemove_Click(ByVal sender As Object, ByVal e As EventArgs)
RefreshGrid() 'Refreshes shopping cart grid
OrderSummary.Refresh() 'Not working
End Sub
Protected Sub CommandEventHandler(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim e1 As GridCommandEventArgs = TryCast(e, GridCommandEventArgs)
If Not e1 Is Nothing Then
grdMain_ItemCommand(sender, e1)
End If
End Sub
Protected Sub grdMain_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles grdMain.ItemCommand
Dim table As DataTable = CType(ViewState("dtCart"), DataTable)
If e.CommandName = "Delete" Then
Dim index As Integer = e.Item.ItemIndex
table.Rows(index).Delete()
'more code to remove item(s) from radgrid
End Sub
javascript asp.net vb.net postback radgrid
add a comment |
up vote
0
down vote
favorite
I have looked all over SO for an answer, but my case seems to be a bit different than the ones posted. I have a Radgrid (Shopping Cart) on my form along with other components (order summary, for example). I want to be able to delete a row from the radgrid and refresh order summary.
What I have tried so far:
- Used Radgrid's ItemCommand with a button to delete row. This deletes
the row just fine but does not refresh order summary. - Used a button's 'onclick' property to delete row and refresh order summary. This does not actually save the updated radgrid (with
the row removed). - Implemented Step 1 with a LinkButton. Same issue.
- Used a button's onclick property to then call ItemCommand and delete the row. This deletes the row but does not refresh summary.
I am fairly new to VB, and what I think is happening is when row is deleted using ItemCommand, it's updating the radgrid, but the form is not submitting. Shouldn't button_onclick handle that?
What am I doing wrong? Any help/suggestion would be highly appreciated!
Edit:
Here is my .aspx code:
<asp:LinkButton ID="lnkRemove" OnClick="lnkRemove_Click" OnCommand="CommandEventHandler" CommandName="Delete" runat="server" Text="Remove" />
And here's my codebehind:
Protected Sub lnkRemove_Click(ByVal sender As Object, ByVal e As EventArgs)
RefreshGrid() 'Refreshes shopping cart grid
OrderSummary.Refresh() 'Not working
End Sub
Protected Sub CommandEventHandler(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim e1 As GridCommandEventArgs = TryCast(e, GridCommandEventArgs)
If Not e1 Is Nothing Then
grdMain_ItemCommand(sender, e1)
End If
End Sub
Protected Sub grdMain_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles grdMain.ItemCommand
Dim table As DataTable = CType(ViewState("dtCart"), DataTable)
If e.CommandName = "Delete" Then
Dim index As Integer = e.Item.ItemIndex
table.Rows(index).Delete()
'more code to remove item(s) from radgrid
End Sub
javascript asp.net vb.net postback radgrid
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have looked all over SO for an answer, but my case seems to be a bit different than the ones posted. I have a Radgrid (Shopping Cart) on my form along with other components (order summary, for example). I want to be able to delete a row from the radgrid and refresh order summary.
What I have tried so far:
- Used Radgrid's ItemCommand with a button to delete row. This deletes
the row just fine but does not refresh order summary. - Used a button's 'onclick' property to delete row and refresh order summary. This does not actually save the updated radgrid (with
the row removed). - Implemented Step 1 with a LinkButton. Same issue.
- Used a button's onclick property to then call ItemCommand and delete the row. This deletes the row but does not refresh summary.
I am fairly new to VB, and what I think is happening is when row is deleted using ItemCommand, it's updating the radgrid, but the form is not submitting. Shouldn't button_onclick handle that?
What am I doing wrong? Any help/suggestion would be highly appreciated!
Edit:
Here is my .aspx code:
<asp:LinkButton ID="lnkRemove" OnClick="lnkRemove_Click" OnCommand="CommandEventHandler" CommandName="Delete" runat="server" Text="Remove" />
And here's my codebehind:
Protected Sub lnkRemove_Click(ByVal sender As Object, ByVal e As EventArgs)
RefreshGrid() 'Refreshes shopping cart grid
OrderSummary.Refresh() 'Not working
End Sub
Protected Sub CommandEventHandler(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim e1 As GridCommandEventArgs = TryCast(e, GridCommandEventArgs)
If Not e1 Is Nothing Then
grdMain_ItemCommand(sender, e1)
End If
End Sub
Protected Sub grdMain_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles grdMain.ItemCommand
Dim table As DataTable = CType(ViewState("dtCart"), DataTable)
If e.CommandName = "Delete" Then
Dim index As Integer = e.Item.ItemIndex
table.Rows(index).Delete()
'more code to remove item(s) from radgrid
End Sub
javascript asp.net vb.net postback radgrid
I have looked all over SO for an answer, but my case seems to be a bit different than the ones posted. I have a Radgrid (Shopping Cart) on my form along with other components (order summary, for example). I want to be able to delete a row from the radgrid and refresh order summary.
What I have tried so far:
- Used Radgrid's ItemCommand with a button to delete row. This deletes
the row just fine but does not refresh order summary. - Used a button's 'onclick' property to delete row and refresh order summary. This does not actually save the updated radgrid (with
the row removed). - Implemented Step 1 with a LinkButton. Same issue.
- Used a button's onclick property to then call ItemCommand and delete the row. This deletes the row but does not refresh summary.
I am fairly new to VB, and what I think is happening is when row is deleted using ItemCommand, it's updating the radgrid, but the form is not submitting. Shouldn't button_onclick handle that?
What am I doing wrong? Any help/suggestion would be highly appreciated!
Edit:
Here is my .aspx code:
<asp:LinkButton ID="lnkRemove" OnClick="lnkRemove_Click" OnCommand="CommandEventHandler" CommandName="Delete" runat="server" Text="Remove" />
And here's my codebehind:
Protected Sub lnkRemove_Click(ByVal sender As Object, ByVal e As EventArgs)
RefreshGrid() 'Refreshes shopping cart grid
OrderSummary.Refresh() 'Not working
End Sub
Protected Sub CommandEventHandler(ByVal sender As Object, ByVal e As CommandEventArgs)
Dim e1 As GridCommandEventArgs = TryCast(e, GridCommandEventArgs)
If Not e1 Is Nothing Then
grdMain_ItemCommand(sender, e1)
End If
End Sub
Protected Sub grdMain_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles grdMain.ItemCommand
Dim table As DataTable = CType(ViewState("dtCart"), DataTable)
If e.CommandName = "Delete" Then
Dim index As Integer = e.Item.ItemIndex
table.Rows(index).Delete()
'more code to remove item(s) from radgrid
End Sub
javascript asp.net vb.net postback radgrid
javascript asp.net vb.net postback radgrid
edited Nov 11 at 20:45
asked Nov 9 at 21:59
monalisa
63
63
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04
add a comment |
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Can you please provide some code so maybe I can help for you. Because If you write down that have you done it's not helping maybe you did good just you missed a part from the code
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Can you please provide some code so maybe I can help for you. Because If you write down that have you done it's not helping maybe you did good just you missed a part from the code
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
add a comment |
up vote
0
down vote
Can you please provide some code so maybe I can help for you. Because If you write down that have you done it's not helping maybe you did good just you missed a part from the code
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
add a comment |
up vote
0
down vote
up vote
0
down vote
Can you please provide some code so maybe I can help for you. Because If you write down that have you done it's not helping maybe you did good just you missed a part from the code
Can you please provide some code so maybe I can help for you. Because If you write down that have you done it's not helping maybe you did good just you missed a part from the code
answered Nov 10 at 16:26
Romeo Berenyi
63
63
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
add a comment |
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
Thanks Romeo, please see my edit for the code.
– monalisa
Nov 11 at 20:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233785%2fdelete-row-from-radgrid-and-refresh-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I resolved the issue by adding another button 'Update Order' on the form that then posts the page back to the server and order summary gets refreshed. I was making this way more complicated than it should've been.
– monalisa
Nov 12 at 15:04