Slut
J'ai un "Control User" dans lequel j'ai une balise panel contenant un gridview. Ce "Control User" est utilisé dans une page aspx classique.
Le gridview est rempli dynamiquement à l'aide d'un datable.
Voici le code du gridview
<asp:GridView runat="server" ID="gdvAgenda" ShowHeader="true" GridLines="Both" AutoGenerateColumns="false" AllowPaging="false" AllowSorting="false" Width="100%" OnRowCommand="gdvAgenda_RowCommand">
<Columns>
<asp:ButtonField ImageUrl="~/Images/Selection.png" ButtonType="Image" CommandName="Open" />
<asp:BoundField DataField="Dossier" HeaderText="Dossier" ReadOnly="True" />
....
</Columns>
<EmptyDataTemplate>
<asp:Label runat="server" CssClass="LabelCenter">Il n'y a aucun dossier</asp:Label>
</EmptyDataTemplate>
</asp:GridView>Mon problème est que je ne récupère pas l'évenèment "RowCommand".
La fonction rowCommand est la suivante:
protected void gdvAgenda_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Open")
{
string t = gdvAgenda.Rows[Int32.Parse(e.CommandArgument.ToString())].Cells[1].Text;
Session.Add("NumeroDossier", int.Parse(gdvAgenda.Rows[Int32.Parse(e.CommandArgument.ToString())].Cells[1].Text));
....
}
}Quelqu'un pourrait me dire où se trouve le problème.
merci d'avance.
PS, je dois utiliser un control user, je n'ai pas vraiement le choix.