Good day,
I have an issue, I'm trying to hide a pair of labels in the grid binding process however the following code doesn't work
And the code behind:
I pretend both edit them in the GridEditFormItem event and insert them in the GridEditFormInsertItem event however I don't need to display them when I'm loading the grid the first time.
Any suggestion??
Thanks in advance!!
All the Best,
William
I have an issue, I'm trying to hide a pair of labels in the grid binding process however the following code doesn't work
//item is about to select if ((e.Item is GridDataItem && !(!(e.Item is GridEditFormInsertItem) && e.Item.IsInEditMode)) && !((e.Item.OwnerTableView.IsItemInserted && e.Item is GridEditFormInsertItem))) { GridDataItem item = (GridDataItem)e.Item; Label label = (Label)item["Encargado2"].FindControl("LabelEncargado2"); label.Visible = false; Label label2 = (Label)item["Email2"].FindControl("Email2"); label2.Visible = false; label.Parent.Parent.Visible = false;<- This is my problem (it doesn't work!!) label2.Parent.Parent.Visible = false; }And the code behind:
<telerik:GridTemplateColumn UniqueName="Encargado2" DataField="Encargado2" HeaderText="Encargado2" ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" > <ItemTemplate> <asp:Label ID="LabelEncargado2" runat="server" Text='<%#Eval("Encargado2") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="Email2" DataField="Email2" HeaderText="Email2" ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" > <ItemTemplate> <asp:Label ID="Email2" runat="server" Text='<%#Eval("Email2") %>' Visible="false"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> I pretend both edit them in the GridEditFormItem event and insert them in the GridEditFormInsertItem event however I don't need to display them when I'm loading the grid the first time.
Any suggestion??
Thanks in advance!!
All the Best,
William