Using C#.NET WebBrowser on page with RadPanelBar

5 posts, 0 answers
  1. Dennis
    Dennis avatar
    3 posts
    Member since:
    Jan 2011

    Posted 25 Jan Link to this post

    I’m trying to do something similar to Automation.  I need to drive a Web App containing Telerik controls.  Specifically, I need to click (which activates functionality) on elements of a RadPanelBar.  The RadPanelBar has two levels.  The top level has four siblings, each of which has about a dozen sub items.

     

    I am using a Win Form application running a WebBrowser control.  This hosts the page pointing to the Telerick based web page containing the RadPanelBar.  I can successfully programmatically “Click” the top level item.  I first find the HtmlElement from its text property as shown on the working Telerik application.  I then simply use the element.InvokeMember(“click”) method.  This successfully expands the list of sub items on the page.  Doing the same on the sub elements successfully finds the HtmlElement, but the InvokeMember(“click”) method does nothing.  It does not give an error nor does it activate the code behind associated with the element.

    I’ve looked at the underlying Dom for the page and have done Google searches using key words found in the actual html generated by the RadPanelBar in conjunction with keywords WebBrowser and InvokeMember.  All to no avail.

     

    I am hoping someone with underlying knowledge of the RadPanelBar can suggest reasons why it works on the first tier, but not the second and hopefully points me in the right direction.

    Thanks for any help you can provide.

  2. Ivan
    Admin
    Ivan avatar
    44 posts

    Posted 28 Jan Link to this post

    Hello Dennis,

    We could not reproduce the issue with the information provided so far.

    Since you're using the RadPanelBar control in a quite specific scenario, can you provide us with a sample project demonstrating the issue, so we can test it locally and investigate what is happening?

    Regards,
    Ivan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dennis
    Dennis avatar
    3 posts
    Member since:
    Jan 2011

    Posted 28 Jan Link to this post

    Thank you for taking a look into this. I understand it is not really related to an issue in Telerik.  It is just how I'm trying to access it via an external process.  Anyway...

    Attached, you'll find two Visual Studio projects.

    RadPanelBarApp - is a one page web application with a RadPanelBar with two tiers of items.  It simply uses the OnClientItemClicked event to display the clicked item.  If you run this, you can see the clicked item is displayed whether a first or second tier item is clicked.

    TestForTelerik - is the Windows Form application that uses Microsoft's WebBrowser control to run the RadPanelBarApp page.  You should see the same page described above.  There are two buttons... one programatically "clicks" a first tier entry and the second clicks a second tier entry.  The label only get updated when the first button is clicked.

    Tried to attach... but form won't accept zip files.  How do I go about getting this sample projects to you?
  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 02 Feb Link to this post

    Hello Dennis,

    Thank you for attaching the sample projects.

    Unfortunately the scenario the RadPanelBar is used in is not supported. The control is declared correctly and there are not problems with the way client-side methods are used, however the controls from the ASP.NET AJAX suite are not tested in WinForms environment and WebBrowser controls are not supported.
    It is possible that the js the control relies on is not executed correctly in the WinForms environment, which could lead to unexpected behavior similar to the one you have observed, where a difference in the root and child items' functionality is exhibited.

    Regards,
    Ivan Danchev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Dennis
    Dennis avatar
    3 posts
    Member since:
    Jan 2011

    Posted 04 Feb Link to this post

    Well then... could you put my request back into the public PanelBar forum where it came from so that I can potentially get some constructive help from non Telerik employees?
Back to Top
UI for WPF is Visual Studio 2017 Ready