This is a migrated thread and some comments may be shown as answers.

Find control from radmultipage view using client side

3 Answers 96 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
usr9999
Top achievements
Rank 1
usr9999 asked on 06 Aug 2010, 02:06 PM

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.

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 10 Aug 2010, 12:30 PM
Hello,

Regarding the server-side code - RadMultiPage is just a container, so you can reference the controls inside it directly with their ID, you don't need to use FindControl method.

As to the client-side code - I'm not sure I understand your approach, could you please paste here a simple version of your page, it really will help. Thanks

Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
usr9999
Top achievements
Rank 1
answered on 10 Aug 2010, 03:01 PM

Sure!. I will paste the sample version of my page.

0
Yana
Telerik team
answered on 11 Aug 2010, 08:00 AM
Hello,

We'll review the code as soon as you send it to us.

Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabStrip
Asked by
usr9999
Top achievements
Rank 1
Answers by
Yana
Telerik team
usr9999
Top achievements
Rank 1
Share this question
or