Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2007, 07:17 PM
Registered User
 
Join Date: Feb 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help understanding databinding

I am binding a dataSet to a GridView in C#:

GrivView1.DataSource = ds.Tables[0];
GridView1.DataBind();

aspx:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
</asp:GridView>

I have books on ASP.NET 2.0 and books on C# and books on ADO and SQL. What I can’t figure out is how to combine custom code with GridView. How do I set all the ASP properties for this GridView, so that I can control the formatting for the columns?

Through ASP, the syntax is:

<asp:BoundField DataField="FieldID" HeaderText="FieldID" ReadOnly="True" SortExpression="FieldID" />

But, when I’m handing the binding in C# instead, I don’t understand how to access all the ASP properties.

 How, for example, would I change the header text on the third column?

Thanks for any help with this question.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding Project prasanna.nadgir Need help with your homework? 1 August 23rd, 2007 03:15 PM
Need help understanding validation kscase Pro Visual Basic 2005 1 July 7th, 2007 07:15 PM
Need help understanding DataRow asp_convert ADO.NET 3 March 13th, 2007 02:39 PM
understanding Variable use imroostercogburn C++ Programming 7 July 28th, 2006 06:15 PM
Understanding Session rajuru Beginning PHP 2 September 25th, 2004 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.