4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 25 Aug 2008, 07:33 AM
Hi,
Try accessing RadDatePicker for the GridDateTimeColumn in the edit mode and set its AutoPostBack property to true. Also add the SelectedDateChanged event handler in the code behind so that it will be fired when the date is changed.
ASPX:
CS:
Thanks
Shinu.
Try accessing RadDatePicker for the GridDateTimeColumn in the edit mode and set its AutoPostBack property to true. Also add the SelectedDateChanged event handler in the code behind so that it will be fired when the date is changed.
ASPX:
<telerik:GridDateTimeColumn UniqueName="DateCol" DataField="Date" HeaderText="DateCol" ></telerik:GridDateTimeColumn> |
CS:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) |
{ |
GridEditableItem edititem = (GridEditableItem)e.Item; |
RadDatePicker dtpkr = (RadDatePicker)edititem["DateCol"].Controls[0]; |
dtpkr.AutoPostBack = true; |
dtpkr.SelectedDateChanged += new Telerik.Web.UI.Calendar.SelectedDateChangedEventHandler(dtmpkr_SelectedDateChanged); |
} |
} |
void dtmpkr_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e) |
{ |
} |
Thanks
Shinu.
0
xiaofeng
Top achievements
Rank 1
answered on 26 Aug 2008, 12:54 AM
do you have client event,or other method without postback?
Thanks .Another thing,how can get the row index when it is in edit mode,it can not cause the rowselected event in mode?
Thanks .Another thing,how can get the row index when it is in edit mode,it can not cause the rowselected event in mode?
0
Shinu
Top achievements
Rank 2
answered on 26 Aug 2008, 04:29 AM
Hi,
Try accessing the RadDatePicker for the GridDateTimeColumn on the server side and set the OnDateSelected client side event handler that is excecuted when ever the selected date is changed in the DatePicker.
CS:
JS:
Thanks
Shinu
Try accessing the RadDatePicker for the GridDateTimeColumn on the server side and set the OnDateSelected client side event handler that is excecuted when ever the selected date is changed in the DatePicker.
CS:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) |
{ |
GridEditableItem edititem = (GridEditableItem)e.Item; |
RadDatePicker dtmpkr = (RadDatePicker)edititem["DateCol"].Controls[0]; |
dtmpkr.ClientEvents.OnDateSelected = "OnDateSelected"; |
} |
} |
JS:
<script type="text/javascript" language="javascript" > |
function OnDateSelected() |
{ |
alert('DateSelected') |
} |
</script> |
Thanks
Shinu
0
xiaofeng
Top achievements
Rank 1
answered on 27 Aug 2008, 02:49 AM
Thanks