Hi.
i need to ImageUrl with databinder in radgrid GridTemplateColumn:
MyCode in aspx:
C# Code:
Error in Line:<%# Eval("NeedCall") %>
how to fix the problem?
-------------------------------
I also have another problem:
when use the label or literal or div in GridTemplateColumn, radgrid columns mixed.
but MaxLength property!!! MaxLength does not allow mixed up columns.
The GridBoundColumn can not be used from RadToolTip!
TIA...
i need to ImageUrl with databinder in radgrid GridTemplateColumn:
MyCode in aspx:
<
telerik:GridTemplateColumn
HeaderText
=
"Need Call"
ItemStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
telerik:RadToolTip
ID
=
"RadToolTipCall"
runat
=
"server"
TargetControlID
=
"chkNeedCall"
AutoCloseDelay
=
"10000"
RelativeTo
=
"Element"
Position
=
"MiddleRight"
>
<%# Eval("UsernameNeedCall") %>
</
telerik:RadToolTip
>
<
telerik:RadButton
ID
=
"chkNeedCall"
runat
=
"server"
Width
=
"22px"
Height
=
"22px"
ToggleType
=
"CheckBox"
ButtonType
=
"LinkButton"
CommandArgument='<%# Eval("Id") %>' AutoPostBack="True" OnCommand="btnNeedCall_Click">
<
Image
EnableImageButton
=
"True"
ImageUrl='<%# Eval("NeedCall") %>' IsBackgroundImage="True"></
Image
>
</
telerik:RadButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
C# Code:
protected void gridShow_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
try
{
if (!e.IsFromDetailTable)
{
var db = new MyDataContext();
var reciveMsg = db.TBL_ReceiverMsgs.ToList().Select((c, index) => new
{
RowIndex = index + 1,
c.Id,
c.Body,
NeedCall = c.NeedCall ? "../Images/Sms/deliveryorange.png" : "../Images/Sms/deliveryok.png",
NeedFollow = c.NeedFollow ? "../Images/Sms/deliveryorange.png" : "../Images/Sms/deliveryok.png",
c.UsernameNeedCall
});
gridShowSms.DataSource = reciveMsg;
}
}
catch (Exception)
{
lblException.Text = @"Error!!";
}
}
Error in Line:<%# Eval("NeedCall") %>
how to fix the problem?
-------------------------------
I also have another problem:
when use the label or literal or div in GridTemplateColumn, radgrid columns mixed.
but MaxLength property!!! MaxLength does not allow mixed up columns.
The GridBoundColumn can not be used from RadToolTip!
<
telerik:GridTemplateColumn
HeaderText
=
"Body"
ItemStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
telerik:RadToolTip
ID
=
"RadToolTipBody"
runat
=
"server"
TargetControlID
=
"lblBody"
RelativeTo
=
"Element"
Position
=
"Center"
>
<%# DataBinder.Eval(Container, "DataItem.Body") %>
</
telerik:RadToolTip
>
<
div
style
=
"Width:100px"
ID
=
"lblBody"
runat
=
"server"
><%# Eval("Body") %></
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
TIA...