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
4110
WebDatePicker-Display issue
posted

I have a WebdatePicker in a WebDialogBox. I popup the dialog when a row is selected on a WebDataGrid. In the javascript I am doing the following:

Initalize a var to the datepicker control

function igPerfPlanDueDate_InitializeDatePicker() {

wdplanDueDate = document.getElementById('<%=igPerfPlanDueDate.ClientID %>');

}

Then in the grids RowSelectionChanged event the following

var planDueDate = sender.get_behaviors().get_selection().get_selectedRows(0).getItem(0).get_cellByColumnKey("DATE").get_text();

wdplanDueDate.value = tDueDate.value;

wdplanDueDate.innerText= tDueDate.value;

the value populates fine, but I either cannot get the value to display in the control when it is rendered (see image) or using innerText propery it displays in superscript and throws and object required error. I'm about at the end of my rope. Can someone point me in the right direction to displaying the date from the selected datagrid row in the datepicker control? Thanks!.

 

 

Parents
  • 17590
    Verified Answer
    Offline posted

    Hello dbishop9,

     

    Thank you for posting in the community.

    What I can suggest for achieving your requirement is setting the value for the DatePicker via the set function as such:

    var dueDatePicker;

     

    unction WebDatePicker1_Initialize(sender, eventArgs)

            {

                 dueDatePicker = $find("<%= WebDatePicker1.ClientID %>");

            }

     


    function WebDataGrid1_Selection_RowSelectionChanged(sender, eventArgs)

          {

              var dueDate = sender.get_behaviors().get_selection().get_selectedRows(0).getItem(0).get_cellByColumnKey("Date").get_text();

                 dueDatePicker .set_text(dueDate);

     

       

          }

    I am also attaching the sample project I used to test this for your reference. My test was performed using version 12.2.20122.2075 of NetAdvantage.

     If this sample project is not an accurate demonstration of what you are tying to do, please feel free to modify it and send it back or send a small sample project of your own.

    WebDataGrid&DatePicker.zip
Reply Children