Hello,
I'm currently attempting to retrieve the value of a selection from a dropdown in the edit pop-up. I have been able to retrieve the values entered in a textbox and checkbox as follows:
string ProjectName = (editedItem["ProjectName"].Controls[0] as TextBox).Text;
bool IsActive = (editedItem["IsActive"].Controls[0] as CheckBox).Checked;
When I try to do so with similarly with my dropdown (shown below) I'm getting an error saying the value is null.
(editedItem["ddlContactName"].Controls[0] as DropDownList).SelectedItem.Value;
Is a different approach needed to retrieve values from dropdown cloumns?
Thanks in advance.
I'm currently attempting to retrieve the value of a selection from a dropdown in the edit pop-up. I have been able to retrieve the values entered in a textbox and checkbox as follows:
string ProjectName = (editedItem["ProjectName"].Controls[0] as TextBox).Text;
bool IsActive = (editedItem["IsActive"].Controls[0] as CheckBox).Checked;
When I try to do so with similarly with my dropdown (shown below) I'm getting an error saying the value is null.
(editedItem["ddlContactName"].Controls[0] as DropDownList).SelectedItem.Value;
Is a different approach needed to retrieve values from dropdown cloumns?
Thanks in advance.