Creating a Data Control Field – The CounterField

Posted by: Aaron Goldenthal 5/25/2009 9:45 PM

I’ve created a lot of GridViews to display a lot of data.  In many cases they’re simply displaying tabular data and they include one column with a counter cell, typically created with markup like: 1: <asp:TemplateField HeaderText="#"> 2: <ItemTemplate><%# Container.DataItemIndex + 1 %></ItemTemplate> 3: </asp:TemplateField> While this is not overly complicated, rather than create a field like this yet anot... [More]
Tags: , , ,
Categories: Data Controls
E-mail | Kick it! | DZone it! | Permalink | Comments (2) | Post RSSRSS comment feed