Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 December 3rd, 2003, 06:42 AM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid template column problem

Hi

I'm new .net developer and I have a problem with datagrid.

I create my datagrid DGRighe in a web form with an OleDB data bound. Then I add some empty template columns. On event DGRighe_ItemCreated I add some control to this templates columns like this:

Dim txtRimborso As New TextBox
Dim cbApprova As New CheckBox

e.Item.Cells(9).Controls.Add(txtRimborso)
e.Item.Cells(10).Controls.Add(cbApprova)


Then i create a link button on the web form and i try to read the data of the checkbutton on linkbutton_Click event:


Dim riga As DataGridItem
Dim cbApprova As CheckBox

For Each riga In DGRighe.Items
    cbApprova = CType(riga.Cells(10).Controls(0), CheckBox)
Next


but cbApprova is Nothing. Why?
Buy
Lorenzo
 
Old December 3rd, 2003, 11:05 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Usually, you put whatever controls you want for each datagrid row into the template column HTML. Try starting with that.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Template Column in datagrid prankur ASP.NET 1.0 and 1.1 Professional 1 January 7th, 2006 05:20 PM
template column in datagrid p2pMember ASP.NET 1.0 and 1.1 Basics 1 November 18th, 2005 06:33 PM
Datagrid template column sonurijs ASP.NET 1.x and 2.0 Application Design 1 September 27th, 2005 12:55 PM
Datagrid template column problem sonurijs ASP.NET 1.0 and 1.1 Professional 1 September 27th, 2005 12:53 PM





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