This is a migrated thread and some comments may be shown as answers.

Use of Hiddenfield in a GridTemplateColumn

2 Answers 621 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adigard
Top achievements
Rank 1
Adigard asked on 08 Nov 2011, 05:37 PM
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 Answers, 1 is accepted

Sort by
0
Adigard
Top achievements
Rank 1
answered on 08 Nov 2011, 05:46 PM
HiddenField HiddenFieldIdParticipant = e.Item.FindControl("HiddenFieldIdParticipant") as HiddenField;
0
ali haririan
Top achievements
Rank 1
answered on 21 Jun 2016, 01:43 PM

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);
............................
            }
        }

Tags
Grid
Asked by
Adigard
Top achievements
Rank 1
Answers by
Adigard
Top achievements
Rank 1
ali haririan
Top achievements
Rank 1
Share this question
or