Hello!
I'm testing telerik:RadGrid control..
I would like to use picture (if it exists) on server. If file doesn't exists i would like to use "default_image.jpg". I suppose have to use RadGrid1_ItemDataBound but don't know how?
Right now fixing DataImageUrlFields="Artikal_ID" DataImageUrlFormatString="IMG/{0}_tiny.jpg" work without problem, but don't know to test File.Exists and use correct value.
Any advice?
Now have something like this:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
GroupPanelPosition
=
"Top"
PageSize
=
"20"
AllowSorting
=
"True"
AllowPaging
=
"True"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
>
<
ExportSettings
>
<
Pdf
PageWidth
=
""
>
</
Pdf
>
</
ExportSettings
>
<
MasterTableView
NoMasterRecordsText
=
"Molimo odaberite kategoriju."
AllowMultiColumnSorting
=
"True"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Artikal_ID"
FilterControlAltText
=
"Filter Artikal_ID column"
HeaderText
=
"Šifra artikla"
ReadOnly
=
"True"
SortExpression
=
"Artikal_ID"
UniqueName
=
"Artikal_ID"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
></
ModelErrorMessage
>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridImageColumn
DataImageUrlFields
=
"Artikal_ID"
DataImageUrlFormatString
=
"IMG/{0}_tiny.jpg"
AlternateText
=
""
DataAlternateTextField
=
"Artikal"
ImageAlign
=
"Middle"
ImageWidth
=
"60px"
HeaderText
=
""
HeaderButtonType
=
"None"
>
<
ItemStyle
CssClass
=
"RadGrid"
Height
=
"80px"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
</
telerik:GridImageColumn
>