473,320 Members | 1,802 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,320 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 3499
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.