B
bernadou
I have a simple ASP.NET 2.0 GridView that is bound to a simple query. I’m
getting the data and the GridView is binding and displaying great. I’m stuck
on something that would seem simple, but it is giving me fits.
My query looks like this:
Select [first],[Last],[Gender] FROM [tblNames]
My Grid currently looks like this:
First Last Gender
Joe Smith M
Jane Smith F
I want my Grid to look like this:
First Last Gender
Joe Smith [Male Icon]
Jane Smith [Female Icon]
I want to add an image to each record based on the [Gender] field from the
query, but, I don’t want the [Gender] data to show in the grid. I’ve tried a
few things, but I can’t seem to figure out how to read the data from the
underlying data record while iterating through the rows without showing the
[Gender] data as a collumn.
So far I’ve been using the “GridView1_dataBound†event to work with the
e.Row(X).Cells(X).Controls(X), but I can’t figure out how to get at the data
that is being applied to the dataView row.
I think this should be a common task Can anyone point me in the right
direction?
Thanks!
Bernie
getting the data and the GridView is binding and displaying great. I’m stuck
on something that would seem simple, but it is giving me fits.
My query looks like this:
Select [first],[Last],[Gender] FROM [tblNames]
My Grid currently looks like this:
First Last Gender
Joe Smith M
Jane Smith F
I want my Grid to look like this:
First Last Gender
Joe Smith [Male Icon]
Jane Smith [Female Icon]
I want to add an image to each record based on the [Gender] field from the
query, but, I don’t want the [Gender] data to show in the grid. I’ve tried a
few things, but I can’t seem to figure out how to read the data from the
underlying data record while iterating through the rows without showing the
[Gender] data as a collumn.
So far I’ve been using the “GridView1_dataBound†event to work with the
e.Row(X).Cells(X).Controls(X), but I can’t figure out how to get at the data
that is being applied to the dataView row.
I think this should be a common task Can anyone point me in the right
direction?
Thanks!
Bernie