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

VB.NET Examples?

10 Answers 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nick
Top achievements
Rank 1
Nick asked on 10 Nov 2009, 04:35 PM
Hi,

I'm trying to follow the Using Telerik Extensions for ASP.NET MVC in your project article in the documentation and had no problems until I got to point 6 where the panel bar is added to the page.

My experience of C# is extremely limited and so I'm struggling to translate the example to VB.NET.  The example is as follows:
<% Html.Telerik().PanelBar() 
       .Name("PanelBar"
       .Items(items => 
       { 
           items.Add().Text("Item 1"
                      .Content(() => 
                      {%> 
                            <p>Content</p> 
                       <% }); 
           items.Add().Text("Item 2"
                .Items(subItems =>  
                      { 
                          subItems.Add().Text("Sub Item 1"); 
                          subItems.Add().Text("Sub Item 2"); 
                          subItems.Add().Text("Sub Item 3"); 
                      }); 
       }) 
       .Render(); 
%> 
Can someone post a working VB.NET version of this example at all?

Thanks in advance,
Nick

10 Answers, 1 is accepted

Sort by
0
Yitzhak Khabinsky
Top achievements
Rank 1
answered on 10 Nov 2009, 05:10 PM
0
Nick
Top achievements
Rank 1
answered on 10 Nov 2009, 05:15 PM
No good I'm afraid:
CONVERSION ERROR: Code could not be converted. Details: 
 
-- line 2 col 13: invalid StructMemberDecl 
 
Please check for any errors in the original code and try again. 
 


0
Accepted
Georgi Krustev
Telerik team
answered on 11 Nov 2009, 11:25 AM
Hi Nick,

Please review the attached test project to this message. Unfortunately, because VB.NET does not support Lambda expressions as C# does, you can use the full potential of the fluent interface.

Regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Nick
Top achievements
Rank 1
answered on 11 Nov 2009, 12:03 PM
Hi Georgi,

Many thanks for the reply, that works great.

I have an MVC project at the moment that uses your radMenu for ASP.NET AJAX and I am quite keen to replace it with the MVC one.  Using your example I have managed to create a proof of concept that looks like it will work quite nicely.

With regards the restrictions in VB.NET when it comes to lambdas, have you guys played with the new capabilities of VB.NET 10 yet?

Cheers,
Nick

0
Georgi Krustev
Telerik team
answered on 11 Nov 2009, 01:36 PM
Hello Nick,

Here is a test project in VS2010. Everything works fine with the miltiline support fot lambda expression in VB 10.

Best wishes,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Nick
Top achievements
Rank 1
answered on 11 Nov 2009, 01:52 PM
Wow, you guys are just awesome!  :)

**waits impatiently for VS2010 release**

0
Dave Whiting
Top achievements
Rank 1
answered on 12 Feb 2010, 01:34 PM
Hi,

I too am trying to get the MVC controls working in a VB environment but came across an issue with the following code for binding the menu control to the model:

<%= Html.Telerik().Menu() 
        .Name("Menu") 
        .BindTo(Model, mappings =>  
        { 
            mappings.For(binding => binding 
                    .ItemDataBound((item, category) => 
                    { 
                        item.Text = category.CategoryName; 
                    }) 
                    .Children(category => category.Products)); 
            mappings.For(binding => binding 
                    .ItemDataBound((item, product) => 
                    { 
                        item.Text = product.ProductName; 
                    })); 
        }) 
%> 

The issue is that I can't seem to get the 'mappings.For(...' statement to work.  Can you please show a VB example of binding to the model for the menu control.

Regards

0
Georgi Krustev
Telerik team
answered on 17 Feb 2010, 03:43 PM
Hello Mark,

Please review the attached test project, which shows how to use Telerik Extentions for ASP.NET MVC with VB9.

Kind regards,
Georgi Krustev
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
jörgen
Top achievements
Rank 1
answered on 16 Jan 2011, 08:40 PM
The example didn't include any code for catching a click on a sub item. How do you do that?
0
jörgen
Top achievements
Rank 1
answered on 16 Jan 2011, 09:32 PM
I figured out how to call a specific view by adding .Action("ActionName","ControllerName") to call a View without parameters but how do i add parametes to the action; ie Controller/Action/Parameter.
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Yitzhak Khabinsky
Top achievements
Rank 1
Nick
Top achievements
Rank 1
Georgi Krustev
Telerik team
Dave Whiting
Top achievements
Rank 1
jörgen
Top achievements
Rank 1
Share this question
or