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

Using C#.NET WebBrowser on page with RadPanelBar

4 Answers 214 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 25 Jan 2016, 01:52 PM

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.

4 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 28 Jan 2016, 08:14 AM
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
0
Dennis
Top achievements
Rank 1
answered on 28 Jan 2016, 03:28 PM

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?
0
Ivan Danchev
Telerik team
answered on 02 Feb 2016, 02:47 PM
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
0
Dennis
Top achievements
Rank 1
answered on 04 Feb 2016, 10:09 AM
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?
Tags
PanelBar
Asked by
Dennis
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Dennis
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or