1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
public MyUC _ucStatut;
protected void Page_Load(object sender, EventArgs e)
{
_ucStatut = (MyUC) LoadControl("MyUC.ascx");
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* lbtnStatut_Click
* Méthode qui lors du click sur le lien "Statut" de l'HoverMenu passe l'ID de la ligne concernée au UserControl
* correspondant et charge dynamiquement ce dernier dans le panel du ModalPopup correspondant.
* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
protected void lbtnStatut_Click(object sender, System.EventArgs e)
{
// Récupère la ligne selectionnée du GridView depuis "sender"
LinkButton lbtnStatut = sender as LinkButton;
GridViewRow row = (GridViewRow)lbtnStatut.NamingContainer;
// passe à la propriété iID du userControl le dataKey (ici: id) de la ligne sélectionnée
this._MyUC.iHawId = Int32.Parse(gvResultat.DataKeys[row.RowIndex].Value.ToString());
// ajoute au Panel de la ModalPopup correspondante le userControl
this.pnlStatut.Controls.Add(_MyUC);
// affiche la modalPopup
this.mpeStatut.Show();
} |
Partager