Hi,
I have an issue hiding one of the controls in my grid. This is the GridTemplateColumn
<Telerik:GridTemplateColumn UniqueName="Results" DataField="Results" HeaderText="Results" AllowFiltering="false" >
<ItemTemplate>
<asp:LinkButton ID="Upload" runat="server" CommandName= "Edit"
Text="Upload" EnableViewState="true">
</asp:LinkButton>
<asp:LinkButton ID="Download" runat="server" CommandName= "Download" CommandArgument='<%# Eval("Results")%>' Text="Download" EnableViewState="true">
</asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadUpload ID="ResultsUpload" runat="server" ControlObjectsVisibility="None" InputSize="55" />
<asp:LinkButton ID="UploadResults" runat="server" CommandName= "Update" Text="Upload" EnableViewState="true" />
</EditItemTemplate>
</Telerik:GridTemplateColumn>
I am trying to hide the Download control depending on certain condition. Here's my vb.net code
Protected Sub Radgrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If TypeOf e.Item Is GridDataItem Then
Dim eItem As GridDataItem = TryCast(e.Item, GridDataItem)
Dim filename As String
For Each item As GridDataItem In RadGrid1.MasterTableView.Items
Dim Download As LinkButton = TryCast(eItem.FindControl("Download"), LinkButton)
filename = Download.CommandArgument
If (Download.CommandArgument = "Not Available" Or Download.CommandArgument = Nothing) Then
Download.Visible = False
Else
Download.Visible = True
End If
Next
End If
End Sub
My problem is I am able to hide all the download linkbuttons except the first row. first row will always shows download button even if the condition is not met.

Any one has any idea about this issue please let me know. Thanks
I have an issue hiding one of the controls in my grid. This is the GridTemplateColumn
<Telerik:GridTemplateColumn UniqueName="Results" DataField="Results" HeaderText="Results" AllowFiltering="false" >
<ItemTemplate>
<asp:LinkButton ID="Upload" runat="server" CommandName= "Edit"
Text="Upload" EnableViewState="true">
</asp:LinkButton>
<asp:LinkButton ID="Download" runat="server" CommandName= "Download" CommandArgument='<%# Eval("Results")%>' Text="Download" EnableViewState="true">
</asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadUpload ID="ResultsUpload" runat="server" ControlObjectsVisibility="None" InputSize="55" />
<asp:LinkButton ID="UploadResults" runat="server" CommandName= "Update" Text="Upload" EnableViewState="true" />
</EditItemTemplate>
</Telerik:GridTemplateColumn>
I am trying to hide the Download control depending on certain condition. Here's my vb.net code
Protected Sub Radgrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If TypeOf e.Item Is GridDataItem Then
Dim eItem As GridDataItem = TryCast(e.Item, GridDataItem)
Dim filename As String
For Each item As GridDataItem In RadGrid1.MasterTableView.Items
Dim Download As LinkButton = TryCast(eItem.FindControl("Download"), LinkButton)
filename = Download.CommandArgument
If (Download.CommandArgument = "Not Available" Or Download.CommandArgument = Nothing) Then
Download.Visible = False
Else
Download.Visible = True
End If
Next
End If
End Sub
My problem is I am able to hide all the download linkbuttons except the first row. first row will always shows download button even if the condition is not met.
Any one has any idea about this issue please let me know. Thanks