Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
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 March 1st, 2006, 12:15 AM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Indent" field in gridview template.

I want to "indent" the text in a label control in a gridview template field, in variable amounts, based on the value in another hidden control in the same template field. (So, ident of targetText = X times value of indentLevel)

I can either add a field in front of the target field, and modify it's width, or add some blanks to the front of the text in the target field.

In either case, I've got to figure out where to perform the detailed field modification. It's strictly for display, and the level value will change, so don't want to store the indent itself in the database.

I was thinking of doing the field modifications in the _RowDataBound event, where I can access the rows as they are created.

My questions here is:

> Would this work, i.e., will the data be available at that time for modification, on a row by row basis?
> If this would work, how do I access the controls within the rows? I've got another operation that's occuring at this point, where I access the rows as objects. However, I don't know the synatax for getting and setting values of the label controls within the rows.

Any guidance on how to make this work (or information about why it won't work), would be appreciated. (My current fallback position would be to do something in SQL as part of the Select command for filling the gridview.)

Thanks!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Databinding DropDownList in gridview template hughworm BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 0 October 15th, 2008 11:16 AM
Generating Textboxes with the GridView Template yes_no ASP.NET 2.0 Professional 3 September 13th, 2008 07:48 AM
Replace Gridview field if null with new field Indo77 ASP.NET 2.0 Basics 1 June 18th, 2007 06:22 AM
Image Button as Template Field in GridView control vbmazza ASP.NET 2.0 Professional 10 May 27th, 2007 10:03 AM
Need to get value of gridview template columns for kmh030 ASP.NET 2.0 Professional 1 January 6th, 2007 11:10 PM





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