86 lines
2.0 KiB
C#
86 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace PUB.WebUserContols
|
|
{
|
|
public partial class mod_anagCond : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// indicato (nuovo) numero righe x pagina
|
|
/// </summary>
|
|
public event EventHandler eh_selected;
|
|
/// <summary>
|
|
/// indicato (nuovo) numero righe x pagina
|
|
/// </summary>
|
|
public event EventHandler eh_reset;
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
grView.PageSize = cmp_numRow.numRowPag;
|
|
}
|
|
cmp_numRow.eh_newNum += Cmp_numRow_eh_newNum;
|
|
}
|
|
|
|
private void Cmp_numRow_eh_newNum(object sender, EventArgs e)
|
|
{
|
|
grView.PageSize = cmp_numRow.numRowPag;
|
|
}
|
|
/// <summary>
|
|
/// Update num righe selezionate
|
|
/// </summary>
|
|
private void updNumRows()
|
|
{
|
|
int rowCount = 0;
|
|
rowCount = grView.PageSize * grView.PageCount;
|
|
lblNumRecords.Text = string.Format("~{0} rec", rowCount);
|
|
}
|
|
|
|
protected void lbtReset_Click(object sender, EventArgs e)
|
|
{
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
// sollevo evento nuovo valore...
|
|
if (eh_reset != null)
|
|
{
|
|
eh_reset(this, new EventArgs());
|
|
}
|
|
}
|
|
public void doUpdate()
|
|
{
|
|
grView.DataBind();
|
|
}
|
|
public int idxCond
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(grView.SelectedValue.ToString(), out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
protected void grView_DataBound(object sender, EventArgs e)
|
|
{
|
|
updNumRows();
|
|
}
|
|
|
|
protected void ddlAmmin_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// sollevo evento nuovo valore...
|
|
if (eh_selected != null)
|
|
{
|
|
eh_selected(this, new EventArgs());
|
|
}
|
|
}
|
|
}
|
|
} |