How to access ASPxGridView inside DetailRow...............
for (int i = 0; i < AssetListGrid.VisibleRowCount; i++)
{
if (AssetListGrid.Selection.IsRowSelected(i))
{
ASPxGridView IGV = AssetListGrid.FindDetailRowTemplateControl(i, "InnerGrid") as ASPxGridView;
for (int j = 0; j < IGV.VisibleRowCount; j++)
{
if (IGV.Selection.IsRowSelected(j))
{
String DisplayDetailsID = IGV.GetRowValues(i, "DisplayDetailsID").ToString();
//(ASPxTextBox)IGV.FindRowCellTemplateControl(j, IGV.Columns["DisplayDetailsID"] as GridViewDataColumn, "DisplayDetailsID");
ASPxTextBox OfferPrice = (ASPxTextBox)IGV.FindRowCellTemplateControl(j, IGV.Columns["OfferPrice"] as GridViewDataColumn, "OfferPrice");
myInsertQuery = "INSERT INTO dbo.OrderDisplayDetails([OrderConfirmationID],[DisplayDetailsID],[QuotationID],[QuotationPrice]) Values(@OrderConfirmationID,@DisplayDetailsID,@QuotationID,@QuotationPrice)";
myCommand = new SqlCommand(myInsertQuery, myConnection);
myCommand.Connection = myConnection;
myCommand.Parameters.AddWithValue("@OrderConfirmationID", txtOrderConfirmationID.Text);
myCommand.Parameters.AddWithValue("@DisplayDetailsID", DisplayDetailsID);
myCommand.Parameters.AddWithValue("@QuotationID", comboQuotationID.SelectedItem.Value);
myCommand.Parameters.AddWithValue("@QuotationPrice", OfferPrice.Text);
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
}
}
}
}
No comments:
Post a Comment