sorting datagrid columns with variable names

D

davey.phillips

I have a datagrid within a datagrid which is filled with data from an
SQL Server db. Each inner datagrid is populated by an sql statement
which contains a variable column name. Output looks something like
this:

Dept no_valid no_invalid
a 4 1
b 7 2
c 3 5

Team no_valid no_invalid
a1 2 1
a2 1 0
b1 3 0


The 2nd and 3rd column titles are always the same, the first column
title is taken from the variable column name in the SQL statement
(stored procedure). This is then passed to a string, and I do

<code>
e.Item.Cells(0).Text = str_header_name
</code>

in the subroutine that handles each line of the inner datagrid.

When I run the page, the second and third columns appear as hyperlinks
and allow me to sort. The first doesn't, cos it's name's a variable.

Is there any way for me to get this to appear as a hyperlink, and have
standard sort functionality?

Any help would be greatly appreciated, but please go easy on me, cos
I'm a total noob to asp.

Cheers.
 
D

DaveyP

I have a datagrid within a datagrid which is filled with data from an
SQL Server db. Each inner datagrid is populated by an sql statement
which contains a variable column name. Output looks something like
this:

Dept no_valid no_invalid
a 4 1
b 7 2
c 3 5

Team no_valid no_invalid
a1 2 1
a2 1 0
b1 3 0

The 2nd and 3rd column titles are always the same, the first column
title is taken from the variable column name in the SQL statement
(stored procedure). This is then passed to a string, and I do

<code>
e.Item.Cells(0).Text = str_header_name
</code>

in the subroutine that handles each line of the inner datagrid.

When I run the page, the second and third columns appear as hyperlinks
and allow me to sort. The first doesn't, cos it's name's a variable.

Is there any way for me to get this to appear as a hyperlink, and have
standard sort functionality?

Any help would be greatly appreciated, but please go easy on me, cos
I'm a total noob to asp.

Cheers.

<<bump>>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top