Hi there,
Please help... I've been hitting my head on the wall for over a day on this. Searched and search but cannot find close solution...
Here is my problem.
I have a Radgrid that has a RadBinaryImage in the first cell of each row. I'm binding my grid on the clientside using json. I want to be able to change the image of the rows from clientside based on a criterion upon
Please help... I've been hitting my head on the wall for over a day on this. Searched and search but cannot find close solution...
Here is my problem.
I have a Radgrid that has a RadBinaryImage in the first cell of each row. I'm binding my grid on the clientside using json. I want to be able to change the image of the rows from clientside based on a criterion upon
ClientEvents-OnRowDataBound.
Here is my snippet:
ASPX:
-----------------
<telerik:RadGrid ID="RadReqOverview" runat="server" >
<MasterTableView TableLayout= "Auto" EnableViewState="true">
<Columns>
<telerik:GridTemplateColumn HeaderStyle-Width="25px" UniqueName = "FLAG">
<ItemTemplate>
<telerik:RadBinaryImage runat ="server" ID="IMGFLAG" Visible = "true" ImageUrl = "./Images/Open.png" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings ClientEvents-OnRowDataBound = "RowDataBound">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" />
</ClientSettings>
</telerik:RadGrid>
<MasterTableView TableLayout= "Auto" EnableViewState="true">
<Columns>
<telerik:GridTemplateColumn HeaderStyle-Width="25px" UniqueName = "FLAG">
<ItemTemplate>
<telerik:RadBinaryImage runat ="server" ID="IMGFLAG" Visible = "true" ImageUrl = "./Images/Open.png" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings ClientEvents-OnRowDataBound = "RowDataBound">
<Selecting AllowRowSelect="True" />
<Scrolling AllowScroll="True" />
</ClientSettings>
</telerik:RadGrid>
Clientside(Javascript)
---------------------------------
<script type="text/javascript">
function RowDataBound(sender, args) {
//Get handle of binaryimage for this cell upon databound
var img = args.get_item().findControl("IMGFLAG"); //This is not working!!!!!!!!!
if (img != null) {
// conditional formatting
// After I do my logic I want to change the image to closed
img.ImageUrl = "./Images/Closed.png";
}
}
</Script>
However this is not working!!! Please help. Thanks.