|
-
DataGrid Boundcolumn vs Template column
I have a datagrid with a bound column and a template column as given below.
When I scan through the grid, I get the value of the first column (bound column). However, I cannot get the value of the second column (Template Column). I can see the data in both columns though.
////////////////////////////////////////////////////////////////////////////////////
<AlternatingItemStyle BackColor="#e0e0e0"></AlternatingItemStyle>
<Columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"> </asp:BoundColumn>
<asp:TemplateColumn HeaderText="Facility2">
<ItemStyle HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
</ItemTemplate>
</asp:TemplateColumn>
////////////////////////////////////////////////////////////////////////////////////
foreach (System.Web.UI.WebControls.DataGridItem GridRow in Grid.Items)
{
string str_first_column_value = GridRow.Cells[0].Text ///returns good value
string str_second_column_value = GridRow.Cells[1].Text //returns no value
}
Is there any other syntax to retrieve the TemplateColumn value?
Similar Threads
-
Replies: 0
Last Post: 02-23-2006, 10:34 PM
-
Replies: 3
Last Post: 10-21-2005, 08:56 AM
-
By Greg Rothlander in forum ASP.NET
Replies: 3
Last Post: 10-23-2003, 02:55 PM
-
By David Hirschfeld in forum .NET
Replies: 0
Last Post: 09-17-2002, 12:15 PM
-
Replies: 1
Last Post: 06-11-2001, 06:14 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks