Hi,
I'm having some small problems with RadGrid.
Issue 1:
Here is an example page
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=1&type=simpel&q=test
When I fill in a value in the textbox the first time and then I click "Kjøp" then it does not find the value of the textbox, and just add 1 item to cart (handlevogn), but the second time I click "kjøp" it finds the value enter in the textbox.
Here is my ItemCommand code:
Why do this happen?
Issue 2:
Who can I "reset" the sort, so it goes back to first sort state?
Here is an example page:
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=2&type=simpel&q=test
If I click "Vis treff A-Å" how can I go back to the sort state the radgrid started with?
Thanks in advaned...
I'm having some small problems with RadGrid.
Issue 1:
Here is an example page
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=1&type=simpel&q=test
When I fill in a value in the textbox the first time and then I click "Kjøp" then it does not find the value of the textbox, and just add 1 item to cart (handlevogn), but the second time I click "kjøp" it finds the value enter in the textbox.
Here is my ItemCommand code:
protected void radResult_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
switch (e.CommandName)
{
case "AddToCart":
int test = e.Item.DataSetIndex;
TextBox txtQuantity = (TextBox)(e.Item.FindControl("txtQuantity"));
if (txtQuantity.Text.Length > 0)
ShoppingCart.GetCurrentUsersCart.AddItem(int.Parse(e.CommandArgument.ToString()), int.Parse(txtQuantity.Text.ToString()));
else
ShoppingCart.GetCurrentUsersCart.AddItem(int.Parse(e.CommandArgument.ToString()), 1);
txtQuantity.Text = "";
RadAjaxManager1.ResponseScripts.Add("javascript:updateCart();");
//RadAjaxManager1.ResponseScripts.Add(string.Format("alert('Hello from the server! Server time is {0}');", DateTime.Now.ToLongTimeString()));
break;
}
}
Why do this happen?
Issue 2:
Who can I "reset" the sort, so it goes back to first sort state?
Here is an example page:
http://dev2.spireweb.no/resultat.aspx?pid=15&rb=2&type=simpel&q=test
If I click "Vis treff A-Å" how can I go back to the sort state the radgrid started with?
Thanks in advaned...