W
William Youngman
I have a gridview displaying data and would like to use the AJAX dropdown extender so that when the user clicks on a record a dropdown menu will display providing the user with a menu of selections to choose from (yes much like the SharePoint 2007 dropdown menu).
I'm having problems dynamically binding the 'TargetControlID' property of the extender control to the record label in the gridview.
What I'm doing is -
The label's text is the record number for the user to choose from.
AJ_Dropdown is the AJAX Dropdown Extender control
I'm getting a run-time error stating 'The TargetControlID of AJ_DropDown' is not valid. A control with ID 'PIDP3 - #3' could not be found.'
//Pseudocode
Code called in the ItemDataBound method of the gridview
if (e.Item is GridViewItem)
{
GridViewItemDataItem = e.Item as GridViewItem;
Label label = (Label)DataItem.FindControl("lblPID");
if (label != null)
{
label.ID = "PID" + label.Text;
AJ_DropDown.TargetControlID = label.ID; -- Proposal number for current row
}
}
Can't figure out what I'm doing wrong.
Any suggestions/ideas?
Thanks,
Bill Youngman
I'm having problems dynamically binding the 'TargetControlID' property of the extender control to the record label in the gridview.
What I'm doing is -
The label's text is the record number for the user to choose from.
AJ_Dropdown is the AJAX Dropdown Extender control
I'm getting a run-time error stating 'The TargetControlID of AJ_DropDown' is not valid. A control with ID 'PIDP3 - #3' could not be found.'
//Pseudocode
Code called in the ItemDataBound method of the gridview
if (e.Item is GridViewItem)
{
GridViewItemDataItem = e.Item as GridViewItem;
Label label = (Label)DataItem.FindControl("lblPID");
if (label != null)
{
label.ID = "PID" + label.Text;
AJ_DropDown.TargetControlID = label.ID; -- Proposal number for current row
}
}
Can't figure out what I'm doing wrong.
Any suggestions/ideas?
Thanks,
Bill Youngman