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?

 

Parents
  • 49378
    posted

    Hello Kociemba,

    Thank you for posting in the community.

    In this scenario it is likely that WebDataGrid has itsEnableAjaxproperty set to true (default), therefore the postbacks on rowselectionchanged are asynchronous and the WebDatePicker is not refreshed. I suggest that you disable WebDataGrid's Ajax. Optionally you may place both WDG and the WebDatePicker in an UpdatePanel to make use of AJAX in this scenario.

    Please let me know if this helps.

Reply Children
No Data