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

Problem with using labels in grid templates

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 13 Feb 2009, 03:22 AM
I have the following code in my aspx page.   
      <telerik:RadGrid...>
                <mastertableview ...>
                    <Columns>  
                         <telerik:GridTemplateColumn Visible = "false">
                         <EditItemTemplate>
                         <asp:Label runat= "server" ID = "test1" Text="bah1" Visible="false"></asp:Label>
                         </EditItemTemplate>
                         </telerik:GridTemplateColumn>
                   <Columns> 
            <mastertableview ...>
          <telerik:RadGrid>
   
however when visible is false, the text is hidden, however the autogenerated ":" is still visible. I can't remove the label, because I need it later on.
                

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Feb 2009, 04:30 AM
Hi Charles,

Give a try with the following code snippet and see whether it helps.

ASPX:
    <telerik:GridTemplateColumn Visible = "false" UniqueName="TempCol"  > 
                         <EditItemTemplate> 
                         <asp:Label runat"server" ID = "test1" Text="bah1" Visible="false"></asp:Label> 
                         </EditItemTemplate> 
                         </telerik:GridTemplateColumn> 

CS:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) 
        { 
            GridEditFormItem editFormItem = (GridEditFormItem)e.Item; 
            editFormItem["TempCol"].Parent.Visible = false
        } 
         
  } 

Thanks
Shinu
Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or