Esempio n. 1
0
    protected void gridResults_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;
        GridViewPreviewRowTemplateContainer container = grid.NamingContainer as GridViewPreviewRowTemplateContainer;

        e.NewValues["Player!Key"] = container.KeyValue;
    }
Esempio n. 2
0
    protected void gridResults_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;
        GridViewPreviewRowTemplateContainer container = grid.NamingContainer as GridViewPreviewRowTemplateContainer;

        Player player = (Player)container.Grid.GetRow(container.VisibleIndex);

        if (lastBestTen == null)
        {
            lastBestTen = player.LastBestTen();
        }

        if (lastBestTen.Count == 0)
        {
            return;
        }

        if (lastBestTen[0].Player != player)
        {
            lastBestTen = player.LastBestTen();
        }

        if (lastBestTen.Find(result => result.Oid == Convert.ToInt32(e.KeyValue)) != null)
        {
            e.Row.BackColor = Color.Yellow;
        }
    }
Esempio n. 3
0
    protected void gridResults_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;
        GridViewPreviewRowTemplateContainer container = grid.NamingContainer as GridViewPreviewRowTemplateContainer;

        xdsResults.Criteria = String.Format("[Player!Key] = {0}", container.KeyValue);
    }
Esempio n. 4
0
    protected void gridResults_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;
        GridViewPreviewRowTemplateContainer container = grid.NamingContainer as GridViewPreviewRowTemplateContainer;

        e.NewValues["Date"]         = DateTime.Now;
        e.NewValues["CourseRating"] = 70;
    }
Esempio n. 5
0
        protected void btnExpand_Click(object sender, EventArgs e)
        {
            ImageButton btn   = (ImageButton)sender;
            Control     table = btn.Parent.Parent.Parent; // button -> cell -> row -> table -> template container
            GridViewPreviewRowTemplateContainer container = (GridViewPreviewRowTemplateContainer)table.Parent;
            object key = container.KeyValue;

            Session[GetKey(key)] = !IsPreviewVisible(key);
            ASPxGridView1.DataBind();
        }