locked
Total records of Entities RRS feed

  • Question

  • User-283288628 posted

    Hi,

    Is there any way to get the total records of entities (not the gridview rows)?

    Best regards

    Wednesday, September 26, 2012 6:49 AM

Answers

  • User-283288628 posted

    In the PageTemplates folder I edit edit List.aspx.cs:

        protected void Page_Load(object sender, EventArgs e) {
            int i = 0;
            Title = table.DisplayName;
            GridDataSource.Include = table.ForeignKeyColumnsNames;
    
            // Deshabilitar varias opciones si la tabla es de solo lectura
            if (table.IsReadOnly) {
                GridView1.Columns[0].Visible = false;
                InsertHyperLink.Visible = false;
                GridView1.EnablePersistedSelection = false;
            }
    // Get enumerator for count all the query records
     IEnumerator EmpEnumerator = table.GetQuery().GetEnumerator(); //EmpEnumerator.Reset(); while (EmpEnumerator.MoveNext()) { i++; } lbTotal.Text = i.ToString(); }

    It works for me.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 26, 2012 8:02 AM