Example #1
0
    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 = ViewOffer.SelectCountCached();
            GXGridView1.DataBind();

            string offerNumber = e.Values["OfferNumber"] as string;
            Offer  o           = Offer.GetByNumber(offerNumber);

            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;
            odsOfferPreview.SelectParameters.Clear();
            odsOfferPreview.SelectParameters.Add("id", GXgvSelectedValue.ToString());
            dvOfferPreview.DataBind();
            odsGridViewOfferItems.SelectParameters.Clear();
            odsGridViewOfferItems.SelectParameters.Add("offerID", GXgvSelectedValue.ToString());
            GridViewOfferItems.DataBind();

            mvMain.SetActiveView(viewOfferItems);
            mvOfferItems.SetActiveView(viewOfferItemsGrid);
        }
    }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GXGridView1.TotalRecords = ViewOffer.SelectCountCached();
         mvMain.SetActiveView(viewGrid);
         reportControl.BranchName  = BrokerHouseInformation.GetBrokerHouseNameByCode(BrokerHouseInformation.FIRST_ROW);
         reportControl.CompanyName = "Брокерско друштво";
     }
 }
Example #3
0
 protected void ClientDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         e.KeepInEditMode   = true;
         ValidationUtility.ShowValidationErrors(this, e.Exception);
     }
     else
     {
         GXGridView1.TotalRecords = ViewOffer.SelectCountCached();
         GXGridView1.DataBind();
         mvMain.SetActiveView(viewGrid);
     }
 }
Example #4
0
 protected void btnDelete_Click1(object sender, EventArgs e)
 {
     GXGridView1.TotalRecords = ViewOffer.SelectCountCached();
     GXGridView1.DataBind();
     mvMain.SetActiveView(viewGrid);
 }
Example #5
0
 protected void DetailsView1_ItemDeleted(object sender, DetailsViewDeletedEventArgs e)
 {
     GXGridView1.TotalRecords = ViewOffer.SelectCountCached();
     GXGridView1.DataBind();
     mvMain.SetActiveView(viewGrid);
 }