Hi,
I'm trying to build a method so that when i fire my select command from one grid it will take the data from the other grid aswell.
protected void gvSuppliers_ToCart(Object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "AddToCart")
{
//ProductGrid "gvDetails"
_productName = Convert.ToString(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ProductName"]);
_productDescription = Convert.ToString(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ProductDescription"]);
_ean = Convert.ToInt32(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["EAN"]);
//SupplierGrid "gvSuppliers"
_supplierName = Convert.ToString(gvSuppliers.MasterTableView.DataKeyValues[e.Item.ItemIndex]["SupplierName"]);
_price = Convert.ToDouble(gvSuppliers.MasterTableView.DataKeyValues[e.Item.ItemIndex]["Price"]);
}
}
}
Now, i'm now quite sure if both grids should have the same "OnItemCommand" or if I could just call it from my SupplierGrid. Please help, need this done by tuesday :S
Atm i'm just getting:
which is not really the most helpful stack trace :(
I'm trying to build a method so that when i fire my select command from one grid it will take the data from the other grid aswell.
protected void gvSuppliers_ToCart(Object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "AddToCart")
{
//ProductGrid "gvDetails"
_productName = Convert.ToString(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ProductName"]);
_productDescription = Convert.ToString(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ProductDescription"]);
_ean = Convert.ToInt32(gvDetails.MasterTableView.DataKeyValues[e.Item.ItemIndex]["EAN"]);
//SupplierGrid "gvSuppliers"
_supplierName = Convert.ToString(gvSuppliers.MasterTableView.DataKeyValues[e.Item.ItemIndex]["SupplierName"]);
_price = Convert.ToDouble(gvSuppliers.MasterTableView.DataKeyValues[e.Item.ItemIndex]["Price"]);
}
}
}
Now, i'm now quite sure if both grids should have the same "OnItemCommand" or if I could just call it from my SupplierGrid. Please help, need this done by tuesday :S
Atm i'm just getting:
[ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +2132776
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +32
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
which is not really the most helpful stack trace :(