Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
875
WebDatePicker not showing Date when using RowSelectionChanged of WDG
posted

HI,

if I use this code in Page_Load event, webDatePicker shows the right Date:

--------

DateTime BaseYear = new DateTime(DateTime.Now.Year,1,2);

FormWebDatePicker = (Infragistics.Web.UI.EditorControls.WebDatePicker)FormView1.FindControl("WebDatePicker1");

FormWebDatePicker.Value = BaseYear.ToShortDateString();

FormWebDatePicker.Text = BaseYear.ToShortDateString();

--------

if i use this code in the RowSelectionChanged-Event of a WDG, WebDatPicker is always empty:

 

--------

int j = Convert.ToInt32(e.CurrentSelectedRows[0].Items[4].Text);  // j = 66

DateTime BaseYear = new DateTime(DateTime.Now.Year,1,2).AddDays(j); //BaseYear.ToShortDateString() = "07.03.2012"

FormWebDatePicker = (Infragistics.Web.UI.EditorControls.WebDatePicker)FormView1.FindControl("WebDatePicker1");

FormWebDatePicker.Value = BaseYear.ToShortDateString();

FormWebDatePicker.Text = BaseYear.ToShortDateString();

 

Why that happend and how to solve this?