using SteamWare;
using System;
using System.Web.UI.WebControls;


namespace NKC_WF.WebUserControls
{
    public partial class mod_lemmiVocab : ApplicationUserControl
    {
        #region protected

        protected override void aggiornaControlliDataGL()
        {
            base.aggiornaControlliDataGL();
            grView.PageSize = _righeDataGridAnagr;
        }

        protected void grView_DataBound(object sender, EventArgs e)
        {
            if (grView.Rows.Count > 0)
            {
                LinkButton lb;
                // aggiorno gli headers        
                foreach (TableCell cella in grView.HeaderRow.Cells)
                {
                    try
                    {
                        lb = (LinkButton)cella.Controls[0];
                        lb.Text = traduci(lb.Text);
                    }
                    catch
                    { }
                }
                int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
                lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
            }
            else
            {
                lblNumRec.Text = "";
            }
        }
        /// <summary>
        /// aggiorna i dati mostrati
        /// </summary>
        public void doUpdate()
        {
            ods.DataBind();
            grView.DataBind();
        }

        #endregion
    }
}