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!.
Thanks Vasya, works great!
Hello dbishop9,
Feel free to contact me if you have any additional questions regarding this matter.
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); }
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.