protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) { if (e.Exception != null) { e.ExceptionHandled = true; e.KeepInInsertMode = true; ValidationUtility.ShowValidationErrors(this, e.Exception); } else { GXGridView1.TotalRecords = OrdersView.SelectCountCached(); GXGridView1.DataBind(); //mvMain.SetActiveView(viewGrid); string orderNumber = e.Values["OrderNumber"] as string; Broker.DataAccess.Order o = Broker.DataAccess.Order.GetByOrderNumber(orderNumber); string DataKeyValue = o.ID.ToString(); int intSelectedIndex = 0; int intPageIndex = 0; int intGridViewPages = GXGridView1.PageCount; // Loop thru each page in the GridView for (int intPage = 0; intPage < intGridViewPages; intPage++) { // Set the current GridView page GXGridView1.PageIndex = intPage; // Bind the GridView to the current page GXGridView1.DataBind(); // Loop thru each DataKey in the GridView for (int i = 0; i < GXGridView1.DataKeys.Count; i++) { if (Convert.ToString(GXGridView1.DataKeys[i].Value) == DataKeyValue) { // If it is a match set the variables and exit intSelectedIndex = i; intPageIndex = intPage; break; } } } // Set the GridView to the values found GXGridView1.PageIndex = intPageIndex; GXGridView1.SelectedIndex = intSelectedIndex; GXGridView1.DataBind(); int GXgvSelectedValue = o.ID; GXGridView1SelectedValue = GXgvSelectedValue; odsOrderPreview.SelectParameters.Clear(); odsOrderPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString()); dvOrderPreview.DataBind(); odsGridViewOrderItems.SelectParameters.Clear(); odsGridViewOrderItems.SelectParameters.Add("orderID", GXgvSelectedValue.ToString()); GridViewOrderItems.DataBind(); mvMain.SetActiveView(viewOrderItems); mvOrderItems.SetActiveView(viewOrderItemsGrid); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GXGridView1.TotalRecords = OrdersView.SelectCountCached(); mvMain.SetActiveView(viewGrid); reportControl.BranchName = BrokerHouseInformation.GetBrokerHouseNameByCode(BrokerHouseInformation.FIRST_ROW); reportControl.CompanyName = "Брокерско друштво"; } }
protected void btnDelete_Click1(object sender, EventArgs e) { ClientAccount ca = ClientAccount.GetByClientAndBank(int.Parse(GXGridView1.SelectedDataKey["ClientID"].ToString()), int.Parse(GXGridView1.SelectedDataKey["BankID"].ToString())); ca.IsActive = false; ClientAccount.Table.Context.SubmitChanges(); GXGridView1.TotalRecords = OrdersView.SelectCountCached(); GXGridView1.DataBind(); mvMain.SetActiveView(viewGrid); }
protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e) { if (e.Exception != null) { e.ExceptionHandled = true; e.KeepInEditMode = true; ValidationUtility.ShowValidationErrors(this, e.Exception); } else { GXGridView1.TotalRecords = OrdersView.SelectCountCached(); GXGridView1.DataBind(); mvMain.SetActiveView(viewGrid); } }
protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e) { GXGridView1.TotalRecords = OrdersView.SelectCountCached(); GXGridView1.DataBind(); mvMain.SetActiveView(viewGrid); }