controlcollection

C# ControlCollection Extension GetAllTextboxes

How could I get only the texboxes in a ControlCollection ? I try : public static IEnumerable<TextBox> TextBoxes(this ControlCollection controlCollection) { return (IEnumerable<TextBox>)controlCollection.Cast<Control>().Where(c => c is TextBox); } But I got the following error : Unable to cast object of type 'WhereEnumerableItera...

Enumerating Collections that are not inherently IEnumerable ?

When you want to recursively enumerate a hierarchical object, selecting some elements based on some criteria, there are numerous examples of techniques like "flattening" and then filtering using Linq : like those found here : link text But, when you are enumerating something like the Controls collection of a Form, or the Nodes collecti...

Will Microsoft ever make all collections useable by LINQ?

I've been using LINQ for awhile (and enjoy it), but it feels like I hit a speedbump when I run across .NET specialized collections(DataRowCollection, ControlCollection). Is there a way to use LINQ with these specialized controls, and if not do you think Microsoft will address this in the next release of the framework? Or are we left to...

Render multiple control collections in ASP.NET custom control

I've build a custom WebControl, which has the following structure: <gws:ModalBox ID="ModalBox1" HeaderText="Title" runat="server"> <Contents> <asp:Label ID="KeywordLabel" AssociatedControlID="KeywordTextBox" runat="server">Keyword: </asp:Label><br /> <asp:TextBox ID="KeywordTextBox" Text="" runat="server" /> </Co...