Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Binding in GridView asp.net 2.0 1

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
It has been over a year since I last worked with ASP.Net and that was .net 1.1. I am now working with VS2005 (.net 2.0) and all the new features that comes with it.

I am binding an xml file to the grid view. When the binding occurs I want to generate controls depending upon the data in the row.

example:
Code:
3 nodes in xml file = 3 rows in grid view
each node has an attribute named "type"
if type = text
 create textbox in template column
else if type = date
 create datetextbox (custom control) in template column
else if type = hidden
 create hidden field with default value
else
 throw exception "invalid control type"
endif
thanks for your help

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
You can create a grid view without specifing a data source. Then click the smart tag and choose edit columns. Add as many template columns as you need. Then use the RowDataBound event and add your controls as needed.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top