Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.)

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 12:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.