I need to copy data from one control --"PlannedStartDate" in RadGrid using GridTemplateColumns to "bStartDate", but the code below that I am using is not working. Any suggestions?
<
telerik:GridTemplateColumn
HeaderText
=
"New Start Date"
UniqueName
=
"bStartDate"
>
<
ItemTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"bStartDate"
Text
=
" "
>
</
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Planned Start Date"
UniqueName
=
"PlannedStartDate"
>
<
ItemTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"plannedstartdate"
Text='<%# String.Format("{0:d}" , Eval("PlannedStartDate")) %>'>
</
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
br
/>
<
telerik:RadDatePicker
ID
=
"picker3"
runat
=
"server"
DbSelectedDate='<%# Bind("PlannedStartDate") %>'>
</
telerik:RadDatePicker
>
<
asp:CustomValidator
ID
=
"CustomValidator3"
ControlToValidate
=
"picker3"
ErrorMessage
=
"This field was incorrect"
runat
=
"server"
OnServerValidate
=
"CustomValidator1_ServerValidate"
>
</
asp:CustomValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridCommandItem && blnApproved)
{
GridCommandItem dataitem = (GridCommandItem)e.Item;
Label PStart = dataitem.FindControl("plannedstartdate") as Label;
Label BStart = dataitem.FindControl("bStartDate") as Label;
BStart.Text = PStart.ToString();
}
}
}