I have a RadGrid with 5 function buttons. I want to hide / show these images on a row by row basis.
This is my Rad grid:
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="EditJobplan" Text="Edit JobPlan" ImageUrl="../App_Themes/Default/Images/JobPlanEdit_24.gif" UniqueName="Change"><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="EditSession" Text="Edit Sessions" ImageUrl="../App_Themes/Default/Images/SessionEdit_24.gif" UniqueName="View"><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Assign" Text="Assign" ImageUrl="../App_Themes/Default/Images/JobPlanAssign_24.gif" UniqueName="Assign"><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Forum" Text="Forum" ImageUrl="../App_Themes/Default/Images/Chat_24.gif" UniqueName="Forum"><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Preview" Text="Preview" ImageUrl="../App_Themes/Default/Images/Preview_24.gif" UniqueName="Preview"><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>
Protected Sub rgJobPlans_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgJobPlans.ItemDataBound |
If TypeOf e.Item Is GridDataItem Then |
Dim dataItem As GridDataItem = CType(e.Item, GridDataItem) |
Dim data As System.Data.DataRowView = TryCast(e.Item.DataItem, System.Data.DataRowView) |
If data("Status").ToString() = "1" Then |
dataItem("Change").Controls(0).Visible = True |
Else |
dataItem("Change").Controls(0).Visible = False |
End If |
End If |
End Sub |
The code shows my ItemDataBound event, What is happening is that the entire column is being hidded / shown not the individual rows, what am I doing wrong?
Andy