Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   GridView Dynamic Column (http://www.velocityreviews.com/forums/t103522-gridview-dynamic-column.html)

=?Utf-8?B?TWFyayBQYXJ0ZXI=?= 05-27-2005 03:12 PM

GridView Dynamic Column
 
I'm adding a dynamic column to a gridview control at runtime but I'm
encountering a problem whereby I can only add 1 item to the column header.

The column header should show the date in the format dd/mm but I need to
store the full date (e.g. dd/mm/yyyy) in a hidden field for the column but
only the last item in code is being rendered. Can you only add 1 item to a
column?

CODE---------------------------

For i = 8 To (e.Row.Cells.Count - 1)
classDate = CType(e.Row.Cells(i).Text, Date)
classDateHidden = New HiddenField
classDateHidden.Value = classDate.ToShortDateString
e.Row.Cells(i).Controls.Add(classDateHidden)
e.Row.Cells(i).Text = String.Format("{0:dd<br />/MM}",
classDate)
Next



All times are GMT. The time now is 12:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57