Related Comboboxes populate 2 RadGrids

6 posts, 0 answers
  1. Rick Hubka
    Rick Hubka avatar
    33 posts
    Member since:
    Apr 2006

    Posted 13 Jun 2009 Link to this post

    I have requirements similar to the Related Comboboxes demo.  I took the code from this demo and replaced third RadComboBox with a RadGrid.  Just like the demo...  The User selects from the first RadComboBox1 which populates and opens the second RadComboBox2.  I need the selection from the second RadComboBox2 to populated 2 RadGrids with the RadComboBox2's "value".  Both RadGrids take the same 3 arguments.  The value from RadComboBox2 plus 2 other arguments so I'm binding the grid in code-behind.

    I'm using your latest version of ASP.NET Ajax,  VS 2008 C# 3.5

    I have searched the forums here and spent days trying dozens of solutions:
    RadAjaxManagerProxy1_AjaxRequest
    RadAjaxManager1_AjaxRequest, etc...

    Now I'm getting weird looks from the boss.

    Each time I attempt to get this to work, I get various problamatic results like:
    The dropdowns work the first time but the second time clicking on the second dropdown does nothing.
    The RadGrid populates but then both dropdowns are blank.
    etc....

    My needs are so much like the Related Comboboxes demo, I'm hoping someone will take the time to modify it to solve my problem.  I'm sure others will benifit from this modified example and it would be a nice added demo to the product.

    Here's my latest version of my JS functions:
                <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
                    <script type="text/javascript"
                        //global variables for the Process and cities comboboxes 
                        var ProcessCombo; 
                        function pageLoad() { 
                            // initialize the global variables 
                            // in this event all client objects 
                            // are already created and initialized 
                            ProcessCombo = $find("<%= RadComboBoxProcess.ClientID %>"); 
                        } 
                        function LoadProcess(combo, eventArqs) { 
                            var item = eventArqs.get_item(); 
                            ProcessCombo.set_text("Loading..."); 
     
                            // if a dept is selected 
                            if (item.get_index() > 0) { 
                                // this will fire the ItemsRequested event of the 
                                // Process combobox passing the DeptGuid as a parameter 
                                ProcessCombo.requestItems(item.get_value(), false); 
                            } 
                            else { 
                                // the -Select a continent- item was chosen 
                                ProcessCombo.set_text(" "); 
                                ProcessCombo.clearItems(); 
                            } 
                        } 
                        function LoadGrid(sender, eventArgs) { 
                            var item = eventArgs.get_item().get_value(); 
     
                            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
                            ajaxManager.ajaxRequest(item); 
                        } 
                        function ItemsLoaded(combo, eventArqs) { 
                            if (combo.get_items().get_count() > 0) { 
                                // pre-select the first item 
                                combo.set_text(combo.get_items().getItem(0).get_text()); 
                                combo.get_items().getItem(0).highlight(); 
                            } 
                            combo.showDropDown(); 
                        } 
                    </script> 
                </telerik:RadCodeBlock> 

    Thanks...  Rick Hubka
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Jun 2009 Link to this post

    Hello Rick,

    Please find attached a simple page baesd on your code demonstrating the needed approach. Download it and give it a try.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rick Hubka
    Rick Hubka avatar
    33 posts
    Member since:
    Apr 2006

    Posted 18 Jun 2009 Link to this post

    Thank you Yana

    Your example code works well and It really cleaned up my code.  Thanks So Much!

    However... when I put the code into my application It worked only once.  Then the second radcombobox box does not fire the RadAjaxManager1_AjaxRequest after the first time. I think, the problem is with my layered implementation.

    My Radcomboboxes and RadGrid both sit on a User Control.  When the Web Site runs this User Control sites on a aspx page that also has a Master page.  I spent the whole day researching this and it appears I need to put my RadAjaxManager object onto my Master Page.  Then put a RadAjaxManagerProxy object onto my aspx page. 

    That all sounds ok, but the problem then is that RadAjaxManagerProxy does not allow a method OnAjaxRequest like this
    OnAjaxRequest="RadAjaxManager1_AjaxRequest"

    So that's what I spent the whole day researching on the forums.

    I'm stuck again.  But it does work once and I'm closer.

    Can you or any of your colleges take the demo you sent me up a few level to match my senerio?
    If you can I will never post for help again...  I promise!!
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 22 Jun 2009 Link to this post

    Hi Rick,

    This help article explains how to handle RadAjaxManager1_AjaxRequest event in the user control when using RadAjaxManagerProxy.

    I've also attached your modified project to demonstrate you the described in the article approach.

    Greetings,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Rick Hubka
    Rick Hubka avatar
    33 posts
    Member since:
    Apr 2006

    Posted 23 Jun 2009 Link to this post

    Hi Yana

    Thank you once again for giving me a simple working demo matching the exact application requirements I was having problems with.
    I've been programming for 20 years and Telerik technical support can not be beat.

    Regards

    Rick Hubka
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 24 Jun 2009 Link to this post

    Hello Rick,

    I'm glad I could help.

    All the best,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017