Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > sorting datagrid columns with variable names

Reply
Thread Tools

sorting datagrid columns with variable names

 
 
davey.phillips@gmail.com
Guest
Posts: n/a
 
      02-28-2007
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.

 
Reply With Quote
 
 
 
 
DaveyP
Guest
Posts: n/a
 
      03-01-2007
On 28 Feb, 11:46, (E-Mail Removed) wrote:
> 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>>

 
Reply With Quote
 
 
 
 
DaveyP
Guest
Posts: n/a
 
      03-02-2007
Sorted.

I did a regex to replace the datagrid.HeaderText.

Problem solved.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for mis-spelled variable names / function names News123 Python 2 11-26-2008 12:37 AM
database columns vs. gui columns and sorting ittay.dror@gmail.com Java 5 03-04-2006 10:48 AM
confusion between global names and instantiated object variable names wanwan Python 3 10-14-2005 09:46 PM
Binded Datagrid Formatting columns or hiding columns ton ASP .Net Web Controls 2 02-11-2004 04:09 AM
Columns and Inherited Datagrid...Active Schema does not support columns rob thomson ASP .Net Datagrid Control 0 09-04-2003 03:09 PM



Advertisments