Re: GridView basics
- From: "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@xxxxxxxxxxxx>
- Date: Sun, 31 Aug 2008 15:56:30 +0300
RowDataBound event is good for formatting.You can format based either on the
output text (e.Row.Cells collection) or on the data as they come from
database (e.Row.DataItem). In the latter case you need to typecast the data
item to the correct class.
I would prefer to join the tables in the same select statement, even if you
end up with a bulky sql.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Peter Laman" <peter.laman@xxxxxxxxx> wrote in message
news:4c9b73dd-513d-41ac-a662-96ca931ddb2f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello, here are some basic GridView questions. I'm using a GridView in
Visual Web Developer to display data from an SQLServer database. I use
C# as programming language.
- How can I format the text in a column. I'm looking for some event
handler that takes the value from the database and formats it for
rendering it on the webpage. Is using a TemplateField the right
direction?
- Some columns in the query contain codes that should be looked up in
lookup tables. I don't want to join all of those tables in the query,
but look them up at display time and render the description in stead
of the code. Is there a typical precooked way to do this?
.
- References:
- GridView basics
- From: Peter Laman
- GridView basics
- Prev by Date: GridView basics
- Next by Date: Re: gridview for two tables
- Previous by thread: GridView basics
- Index(es):
Relevant Pages
|