This is a migrated thread and some comments may be shown as answers.

How to validate a datetimepicker dynamically!!

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rajendra
Top achievements
Rank 1
rajendra asked on 29 Oct 2008, 07:44 AM
Hi I'm binding a radgrid dynamically, hence automatically datetimepicker control created. It works fine, but I need to validate this control through RequiredFieldValidator...  I have used a class to create raddatepicker control as below : 

using

System;

 

 

using

System.Web;

 

 

using

Telerik.Web.UI;

 

 

namespace

RadDatePickerEditorClass

 

{

 

 

public class RadDatePickerEditor: GridTextColumnEditor

 

 

{

 

private RadDatePicker picker;

 

 

 

protected override void LoadControlsFromContainer()

 

{

 

 

this.picker = this.ContainerControl.Controls[0] as RadDatePicker;

 

}

 

 

public override bool IsInitialized

 

{

 

 

get

 

 

{

 

return this.picker != null;

 

}

}

 

 

public override string Text

 

{

 

 

get

 

 

{

 

if (picker.DbSelectedDate == null)

 

{

 

 

return string.Empty;

 

}

 

 

return this.picker.DbSelectedDate.ToString();

 

}

 

 

set

 

 

{

 

this.picker.DbSelectedDate = value;

 

}

}

 

 

protected override void AddControlsToContainer()

 

{

picker =

 

new RadDatePicker();

 

 

 

picker.Skin = "DwtDemo";

 

picker.EnableEmbeddedSkins =

 

false;

 

picker.CssClass =

 

"date-table";

 

ContainerControl.Controls.Add(picker);

picker.MinDate =

 

new DateTime(1900,1,1);

 

 }

}

}

please suggest me how to validate this control...is it possible in this class or in server side .

Thanks in advance

Rajendra

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 29 Oct 2008, 08:30 AM
Hello rajendra,


To see more information on the requested functionality, please refer to the following articles:

Sincerely yours,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
rajendra
Top achievements
Rank 1
Answers by
Missing User
Share this question
or