How can I find the control from the radmultipage view using client side?
The following is what I was trying to do and the code I am using. The code and logic works fine except the item # b
1) I have a data entry screen with radtabstrip and radmultipageview.
2) When user chooses to validate the page. I have a backend process (huge) to identify the errors.
3) If any errors, I would populate the error grid on the screen. I was trying to accomplish the following.
a. When the grid is being loaded, I am highlighting the control label with red font so user knows the error items.
–The code works good.
Dim errorTab As RadTab
errorTab = RadTabStrip1.FindTabByText("tabName")
If Not errorTab Is Nothing Then
errorTab.ForeColor = Drawing.Color.Red
End If
Dim myControl1 As Label = CType(RadMultiPage1.FindControl("SCREEN_CONTROL_label"), Label)
If Not myControl1 Is Nothing Then
myControl1.ForeColor = Drawing.Color.Red
end if
b. I have linkbutton as one of the grid column, when user clicks on it;
user should be able to navigate to the related control on the page.
<script type="text/javascript">
function NavigateToErrorItem(elmName, parentTabName){
var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
var parentTab = tabStrip.findTabByText(parentTabName);
if (parentTab)
{
parentTab.select();
}
id = elmName;
var elm = $find(id);
alert(elm);
if( null == elm )
{
elm = document.getElementById(id);
if( elm )
{
elm.focus();
}
}
else if( null != elm )
{
if( elm.get_inputDomElement )
{
elm = elm.get_inputDomElement();
}
elm.focus();
}
}
</script>
At first I have experimented on the standalone page which worked fine with just findcontrol and $find. My standalone page has RadTabStrip and RadMultipageView too. But when I have integrated on my main app both item #a and item #b were not able to find the control. I have chagned item # a to use “RadMultiPage1.FindControl”, it solved the problem but not able to convert client side to do the same I have tried "var elm = $find(parentTab.elmName);" which gave me an error.
Thank you in advance.