Use of Hiddenfield in a GridTemplateColumn

3 posts, 0 answers
  1. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 08 Nov 2011 Link to this post

    Greetings,

    I have a problem in the following code:

    <telerik:GridTemplateColumn>
        <ItemTemplate>
            <asp:HiddenField ID="HiddenFieldIdParticipant" runat="server" Value='<%#Eval("idUtilisateur")%>' />
        </ItemTemplate>
    </telerik:GridTemplateColumn>


    code behind:

    HiddenField HiddenFieldIdParticipant = GridDisplayOldRDV.FindControl("HiddenFieldIdParticipant") as HiddenField;


    This is not working i don't get anything in my hiddenfield
    Does anyone know why ?
    Thx in advance!
  2. Adigard
    Adigard avatar
    61 posts
    Member since:
    Oct 2011

    Posted 08 Nov 2011 Link to this post

    HiddenField HiddenFieldIdParticipant = e.Item.FindControl("HiddenFieldIdParticipant") as HiddenField;
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ali haririan
    ali haririan avatar
    1 posts
    Member since:
    Apr 2010

    Posted 21 Jun in reply to Adigard Link to this post

    thank you its currect

    asp.net >>> in your radgrid

                                   <telerik:GridTemplateColumn>
                                        <ItemTemplate>
                                            <asp:HiddenField ID="HiddenFieldIdParticipant" runat="server" Value='<%#Eval("id")%>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
    C#
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
            {
                if (e.CommandName == "delete")
                {
                    HiddenField HiddenFieldIdParticipant = e.Item.FindControl("HiddenFieldIdParticipant") as HiddenField;
                    int id = Convert.ToInt32(HiddenFieldIdParticipant.Value);
    ............................
                }
            }

Back to Top