Posts

Showing posts from February, 2010

Handling Dropdownlist inside gridview

Often there is a need to handle OnSelectedIndexChanged event of a dropdown residing inside a GridView. This can be handled as following: 1. Specify an event handler from dropdown in ASPX < asp : GridView ID ="GridView1" runat ="server" AutoGenerateColumns ="False"> < Columns > < asp : TemplateField > < ItemTemplate > < asp : DropDownList OnSelectedIndexChanged ="ddl_Change" DataTextField ="UserName" AutoPostBack ="true" DataValueField ="userId" ID ="ddl" runat ="server"/> 2. Add event handler in ASPX.cs Protected Sub ddl_Change( ByVal sender As Object , ByVal e As EventArgs) 'You can retrieve Dropdown as: Dim DropDownControl As DropDownList = CType (sender, DropDownList) 'You can retrieve Parent GridRow as: Dim gridRow As GridViewRow = CType ( CType (sender, DropDownList).NamingContainer, GridViewRow) ...

Whats new in C# 2.0 3.0 4.0

What's new in C# 2.0 1. Generics 2. Nullable Types 3. Iterators 4. Partial Class Definitions 5. Anonymous Methods 6. The :: Alias Qualifier 7. Static Classes 8. Covariance and Contravariance 9. Fixed-Size Buffers 10. Friend Assemblies 11. extern Aliases 12. Method Group Conversion 13. Accessor Access Control 14. The #pragma Directive What's new in C# 3.0 1. Lambda expressions 2. Extension methods 3. Implicitly typed local variables 4. Query comprehensions 5. Anonymous types 6. Object initializers 7. Implicitly typed arrays 8. Automatic properties 9. Partial methods 10. Expression trees What's new in C# 4.0 1. Named and Optional Parameters 2. Dynamic Support 3. Variance 4. COM Interop