I'm after some help with achieving the following.
I am programmatically creating my RadGrid and it is to contain GridBoundColumns and a GridButtonColumn. The grid button column is to allow for clicking and opening another page. However I would like the ImageUrl for the grid button column to be dependant upon a column value in the datatable. For instance if the value in the column of the row in the datatable is true then show one image but if it is false then show another.
At this point my ascx page looks like so:
<
telerik:RadGrid ID="radGrid1" runat="server" OnItemDataBound="DataBoundMethod">
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
</ClientSettings>
</
telerik:RadGrid>
My ascx.cs page then includes (amongst other btis of code) the following method where I thought I could do what I wanted
protected
void DataBoundMethod(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
//Need to do something here to alter the ImageUrl
}
}
Any thoughts on this? If I am going down the wrong road that is ok, I'm fairly new to the Telerik stuff so am still learning. Any help be would be greatly appreciated.
Many thanks