83 lines
1.9 KiB
C#
83 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MP_MAG.WebUserControls
|
|
{
|
|
public partial class cmp_elencoLotti : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// Generico evento di richiesta refresh a aprent
|
|
/// </summary>
|
|
public event EventHandler eh_doRefresh;
|
|
/// <summary>
|
|
/// Generico evento di richiesta refresh a aprent
|
|
/// </summary>
|
|
public event EventHandler eh_doReset;
|
|
/// <summary>
|
|
/// Lotto selezionato
|
|
/// </summary>
|
|
public string LottoSel
|
|
{
|
|
get
|
|
{
|
|
return grView.SelectedValue.ToString();
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
cmp_numRow.numRow = 10;
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
}
|
|
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
|
}
|
|
|
|
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
|
|
{
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
}
|
|
|
|
/// <summary>
|
|
/// comando reset
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtReset_Click(object sender, EventArgs e)
|
|
{
|
|
resetSelezione();
|
|
}
|
|
|
|
private void resetSelezione()
|
|
{
|
|
grView.SelectedIndex = -1;
|
|
grView.DataBind();
|
|
raiseReset();
|
|
}
|
|
/// <summary>
|
|
/// Chiamata evento
|
|
/// </summary>
|
|
public void raiseReset()
|
|
{
|
|
// se qualcuno ascolta sollevo evento nuovo valore...
|
|
if (eh_doReset != null)
|
|
{
|
|
eh_doReset(this, new EventArgs());
|
|
}
|
|
}
|
|
|
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// se qualcuno ascolta sollevo evento nuovo valore...
|
|
if (eh_doRefresh != null)
|
|
{
|
|
eh_doRefresh(this, new EventArgs());
|
|
}
|
|
}
|
|
}
|
|
} |