PDA

View Full Version : Gridview duplicate column names


MattNolan
10-11-2009, 03:10 PM
I have a gridview where I need to have column names within 1 sortable pageable gridview as the same name, but when I set up the sql query as

select x as 'col', y as 'col', z as 'col'

it shows up in the gridview with autogeneratecolumns on (theres a lot of columns in the page I don't feel like not autogenning it)

and it shows up as

col
col1
col2

in the gridview but I want it to just be col, col, and col. I understand that this could cause a sorting problem without turning autogenerate columns off, but I was hoping there was some type of work around.

Mike_O
10-20-2009, 06:07 PM
Hey MattNolan,

It's funny, I just posted exactly the same link like 5 minutes ago to somebody else. Anyway, this should guide you:
http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/GridViewBoundFields.src

Mike