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

[Solved] Telerik Control throws exception After upgrading from Q1 to Q2 release

6 Answers 86 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.
summia
Top achievements
Rank 1
summia asked on 17 Aug 2011, 10:42 AM
After upgrading from Q1 release to Q2 getting following error on Telerik ComboBox, DropDown and Telerik Grid
InvalidOprationException was unhandled by user
    Error due to Sequence Contains no matching element

Kindly Help me out

6 Answers, 1 is accepted

Sort by
0
CD
Top achievements
Rank 1
answered on 28 Oct 2011, 12:36 PM
I get this exact same issue constantly
0
Atanas Korchev
Telerik team
answered on 28 Oct 2011, 01:16 PM
Hi Cd,

 This is a generic .NET exception which occurs when the Find or Single extension methods are used but no result (or more than one result) is returned. This stackoverflow question explains it in more detail.

 Probably the data to which you are binding the component has changed and makes the code break. Can you isolate the exception in a sample project? A full stacktrace would also be of help.

Regards,

Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
CD
Top achievements
Rank 1
answered on 28 Oct 2011, 01:19 PM
I'm not sure why it would do it tho, it's kinda misleading, the error looks like it's failing on the menu control but my menu control isn't bound to any kind of datasource, it's all being set manually with text data. Do you see any reason for the control itself to error or is it a symptom of some other issue and this is just the stopping point?

                        <%: Html.Telerik().Menu() _
                            .Name("menu") _
                            .Orientation(MenuOrientation.Horizontal) _
                            .Items(Sub(menu)
                                       menu.Add().Text("Home").Action("Index", "Home").HtmlAttributes(New With {.style = "font-size: 8pt;"})
                                       menu.Add().Text("eMASON").Items(Sub(subitem)
                                                                           subitem.Add().Text("About").Url("http://www.emason.biz/content/company/history.aspx").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                           subitem.Add().Text("Clarifire").Url("http://www.emason.biz/content/clarifire/index.aspx").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                           subitem.Add().Text("Contact Us").Url("http://www.emason.biz/content/contact/index.aspx").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                       End Sub)
                                       menu.Add().Text("HUD").HtmlAttributes(New With {.style = "font-size: 8pt;"}).Items(Sub(subitem)
                                                                                                                              subitem.Add().Text("About").Url("http://portal.hud.gov/hudportal/HUD?src=/about").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                                                                              subitem.Add().Text("Contact Us").Url("http://portal.hud.gov/hudportal/HUD?src=/contact").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                                                                          End Sub)
                                       menu.Add().Text("US Department of Treasury").HtmlAttributes(New With {.style = "font-size: 8pt;"}).Items(Sub(subitem)
                                                                                                                                                    subitem.Add().Text("About").Url("http://www.treasury.gov/about/Pages/default.aspx").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                                                                                                    subitem.Add().Text("Contact Us").Url("http://www.treasury.gov/about/Pages/default.aspx").HtmlAttributes(New With {.style = "font-size: 8pt;"}).LinkHtmlAttributes(New With {.target = "_blank"})
                                                                                                                                                End Sub)
                                       menu.Add().Text("Contact Us").HtmlAttributes(New With {.style = "font-size: 8pt;"}).Items(Sub(subitem)
                                                                                                                                     subitem.Add().Text("About").Action("About", "Home").HtmlAttributes(New With {.style = "font-size: 8pt;"})
                                                                                                                                     subitem.Add().Text("Tech Support").Action("TechSupport", "Support").HtmlAttributes(New With {.style = "font-size: 8pt;"})
                                                                                                                                     subitem.Add().Text("Site Feedback").Action("Feedback", "Support").HtmlAttributes(New With {.style = "font-size: 8pt;"})
                                                                                                                                 End Sub)
                                   End Sub)
                        %>
0
Atanas Korchev
Telerik team
answered on 28 Oct 2011, 01:49 PM
Hi Cd,

 This exact code works as expected with the current official release. Find attached my test project.

All the best,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
CD
Top achievements
Rank 1
answered on 28 Oct 2011, 02:07 PM
Yeah it works in mine too when i first hit the page but then when I load a different view (which must have a data problem) the menu gives the error. I have the menu on my master page so when that master reloads with the new view with the data problem thats when it happens.

So that tells me that there's no problem with the menu at all, it's just a side effect.

Thanks
0
Atanas Korchev
Telerik team
answered on 28 Oct 2011, 02:39 PM
Hello Cd,

 This is very strange indeed. Could you somehow reproduce it in the attached project? We would really like to see what is causing this exception and avoid it somehow. Perhaps the stacktrace which ends to the Menu code would indicate the cause of the exception.

Regards,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
General Discussions
Asked by
summia
Top achievements
Rank 1
Answers by
CD
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or