473,219 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,219 software developers and data experts.

Sortable/pagable datagrid with hyperlink column

I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable
datagrid that works.

I want to change one of the columns to a hyperlink. The examples I find use
a bound column. I can get this to work; however, the column header on the
datagrid is not a link/sortable.

What am I missing?

Thanks in advance.
Dec 29 '05 #1
3 3490
Hi,

Welcome to ASPNET newsgroup.
As for the GridView sorting problem you mentioned, I think it is possibly
caused by the sortExpression setting of the HyperLink column you created.
For GridView sorting, it require that each column(which want to be
sortable) provide the SortExpression in its column setting. So when you
manually create a HyperLink column, by default its SortExpression is empty,
have you manually assigned the SortExpression of it to the correct
DataBound field? e.g:

<asp:HyperLinkField DataTextField="CategoryName" HeaderText="Click"
NavigateUrl="CategoryName"
SortExpression="CategoryName" Text="Click" />
</Columns>
</asp:GridView>

You can also set the SortExpression through Design-time User Interface....

#DataControlField.SortExpression Property
http://msdn2.microsoft.com/en-us/lib...rols.datacontr
olfield.sortexpression.aspx
Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Sortable/pagable datagrid with hyperlink column
| thread-index: AcYMsFzwNmOJUPWtS6SAHezmSZPZrg==
| X-WBNR-Posting-Host: 151.143.62.45
| From: "=?Utf-8?B?VFBoZWxwcw==?=" <Un***********@newsgroups.nospam>
| Subject: Sortable/pagable datagrid with hyperlink column
| Date: Thu, 29 Dec 2005 11:45:03 -0800
| Lines: 10
| Message-ID: <4A**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367603
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a sample of an unbound (autogeneratecolumns is true)
sortable/pagable
| datagrid that works.
|
| I want to change one of the columns to a hyperlink. The examples I find
use
| a bound column. I can get this to work; however, the column header on
the
| datagrid is not a link/sortable.
|
| What am I missing?
|
| Thanks in advance.
|

Dec 30 '05 #2
That was it; however, I have another problem now.

There is a graphic (up or down arrow) displayed next to the bound column I
added. Each time I click on that column (at run time) a new graphic is added
to the column heading! i.e. if I click to repeatly sort on it (ascending,
descending, ...) 5 times, I get an up arrow, down arrow, up arrow, down
arrow, up arrow graphics next to the header text.

I tried looking at the header image property but it currently has no value.

Any suggestions?

Thanks in advance...

"Steven Cheng[MSFT]" wrote:
Hi,

Welcome to ASPNET newsgroup.
As for the GridView sorting problem you mentioned, I think it is possibly
caused by the sortExpression setting of the HyperLink column you created.
For GridView sorting, it require that each column(which want to be
sortable) provide the SortExpression in its column setting. So when you
manually create a HyperLink column, by default its SortExpression is empty,
have you manually assigned the SortExpression of it to the correct
DataBound field? e.g:

<asp:HyperLinkField DataTextField="CategoryName" HeaderText="Click"
NavigateUrl="CategoryName"
SortExpression="CategoryName" Text="Click" />
</Columns>
</asp:GridView>

You can also set the SortExpression through Design-time User Interface....

#DataControlField.SortExpression Property
http://msdn2.microsoft.com/en-us/lib...rols.datacontr
olfield.sortexpression.aspx
Hope this helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Sortable/pagable datagrid with hyperlink column
| thread-index: AcYMsFzwNmOJUPWtS6SAHezmSZPZrg==
| X-WBNR-Posting-Host: 151.143.62.45
| From: "=?Utf-8?B?VFBoZWxwcw==?=" <Un***********@newsgroups.nospam>
| Subject: Sortable/pagable datagrid with hyperlink column
| Date: Thu, 29 Dec 2005 11:45:03 -0800
| Lines: 10
| Message-ID: <4A**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367603
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have a sample of an unbound (autogeneratecolumns is true)
sortable/pagable
| datagrid that works.
|
| I want to change one of the columns to a hyperlink. The examples I find
use
| a bound column. I can get this to work; however, the column header on
the
| datagrid is not a link/sortable.
|
| What am I missing?
|
| Thanks in advance.
|

Dec 30 '05 #3
Thanks for your response,

Seems strange behavior. I think it should be code logic specific, are you
dynamically adding the image in that column's header section? Would you
provide some further code snippet on that column and the related code so
that we can have a look?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Sortable/pagable datagrid with hyperlink column
| thread-index: AcYNj3UsCK4A2RGETIiVDJNS6MEqTQ==
| X-WBNR-Posting-Host: 151.143.62.45
| From: "=?Utf-8?B?VFBoZWxwcw==?=" <Un***********@newsgroups.nospam>
| References: <4A**********************************@microsoft.co m>
<J#**************@TK2MSFTNGXA02.phx.gbl>
| Subject: RE: Sortable/pagable datagrid with hyperlink column
| Date: Fri, 30 Dec 2005 14:22:02 -0800
| Lines: 91
| Message-ID: <97**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367823
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| That was it; however, I have another problem now.
|
| There is a graphic (up or down arrow) displayed next to the bound column
I
| added. Each time I click on that column (at run time) a new graphic is
added
| to the column heading! i.e. if I click to repeatly sort on it
(ascending,
| descending, ...) 5 times, I get an up arrow, down arrow, up arrow, down
| arrow, up arrow graphics next to the header text.
|
| I tried looking at the header image property but it currently has no
value.
|
| Any suggestions?
|
| Thanks in advance...
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi,
| >
| > Welcome to ASPNET newsgroup.
| > As for the GridView sorting problem you mentioned, I think it is
possibly
| > caused by the sortExpression setting of the HyperLink column you
created.
| > For GridView sorting, it require that each column(which want to be
| > sortable) provide the SortExpression in its column setting. So when you
| > manually create a HyperLink column, by default its SortExpression is
empty,
| > have you manually assigned the SortExpression of it to the correct
| > DataBound field? e.g:
| >
| > <asp:HyperLinkField DataTextField="CategoryName" HeaderText="Click"
| > NavigateUrl="CategoryName"
| > SortExpression="CategoryName" Text="Click" />
| > </Columns>
| > </asp:GridView>
| >
| > You can also set the SortExpression through Design-time User
Interface....
| >
| > #DataControlField.SortExpression Property
| >
http://msdn2.microsoft.com/en-us/lib...rols.datacontr
| > olfield.sortexpression.aspx
| >
| >
| > Hope this helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | Thread-Topic: Sortable/pagable datagrid with hyperlink column
| > | thread-index: AcYMsFzwNmOJUPWtS6SAHezmSZPZrg==
| > | X-WBNR-Posting-Host: 151.143.62.45
| > | From: "=?Utf-8?B?VFBoZWxwcw==?=" <Un***********@newsgroups.nospam>
| > | Subject: Sortable/pagable datagrid with hyperlink column
| > | Date: Thu, 29 Dec 2005 11:45:03 -0800
| > | Lines: 10
| > | Message-ID: <4A**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:367603
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I have a sample of an unbound (autogeneratecolumns is true)
| > sortable/pagable
| > | datagrid that works.
| > |
| > | I want to change one of the columns to a hyperlink. The examples I
find
| > use
| > | a bound column. I can get this to work; however, the column header
on
| > the
| > | datagrid is not a link/sortable.
| > |
| > | What am I missing?
| > |
| > | Thanks in advance.
| > |
| >
| >
|

Jan 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ravikanth[MVP] | last post by:
Hi asp:DataGrid id="YourID" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="Sample Column"> <ItemTemplate> <asp:Hyperlink runat="server" Text='<%...
2
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four...
9
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring =...
4
by: chuckdfoster | last post by:
I am needing to creat a Sign In/Out Board ASP.NET page. I was going to use a datagrid with everyone's name, in/out, location, and time in it. This data will be stored on a MS SQL Server. I need...
4
by: sakieboy | last post by:
I currently have a datagrid with several columns. The first column in the DataGrid is a HyperLinkColumn. When I select a row, I would like for this HyperlinkColumn to fire. I have the mouseover...
2
by: Fabrice | last post by:
Hello, First, thanks to felix for his answer. But :-( , I'm feeling newbie :! I' don't understand all the situation. The trouble : Always in the road whith my Datagrid and my ItemTemplate...
0
by: cedoucette | last post by:
I just wrote code to support sortable columns in a datagrid. It seems to work fine; but, it doesn't look right. The problem is that I have a generic style for links and a different style for the...
17
by: Mike Fellows | last post by:
im trying (unsucessfully) to add a checkbox column to my datagrid i basically have a datagrid that im populating from a dataset Me.DataGrid1.DataSource = ds.Tables(0) the datagrid then has 5...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.