473,836 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need some help with HyperLinkColumn !

Hi.

After a while I finaly discovered how to use HyperLinkColumn s.
What I can't find is how to send mote than one "value" like
page.aspx?id1&i d2!!!

<asp:HyperLinkC olumn DataNavigateUrl Field="InvoNo"
DataNavigateUrl FormatString="I nvo.aspx?Id={0} " DataTextField=" InvoNo"
HeaderText="Inv o No.">
<HeaderStyle HorizontalAlign ="Left"></HeaderStyle>
<ItemStyle HorizontalAlign ="Left"></ItemStyle>
</asp:HyperLinkCo lumn>

I also need to send: ID2=Request.Que ryString("custn o")
??
Invo.aspx?Id={0 }&ID2=Request.Q ueryString("cus tno")
Thanks...

Morten
Nov 17 '05 #1
3 1228
AW
Hi Morten,

Unfortunately, you can't use more than one column as a data source for an
HyperLinkColumn .

However, if the object that you're binding to your DataGrid is a DataTable,
there's a trick: you can add a new computed column to the DataTable, and
bind this column to your HyperLinkColumn .

In your ASPX, write:
<asp:HyperLinkC olumn DataNavigateUrl Field="InvoNo"
DataNavigateUrl FormatString="I nvo.aspx?{0}" DataTextField=" Computed"
HeaderText="Inv o No.">

and in your CodeBehind, use:
DataSet ds = new DataSet();

sqlDataAdapter2 .Fill(ds);

DataTable t = ds.Tables[0];

DataColumn dc = new DataColumn("Com puted");

dc.Expression=" Id=' + InvoNo + '&id2="+ Request.QuerySt ring("custno") + "'";

t.Columns.Add(d c);

DataGrid1.DataS ource=ds;

DataGrid1.DataB ind();
--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
Nov 17 '05 #2
Thanks AW.

Could You please help me a bit more.

My datagrid are filled like this.

Dim aOpenPost As New OleDb.OleDbData Adapter("SELECT InvoNo, Dt,
Am, CustNo FROM CustTr WHERE (CustNo = '" & AcNo & "' " & tmpDt & ")", cnn)
Dim dsOpenPost As DataSet = New DataSet()
aOpenPost.Fill( dsOpenPost, "CustTr")
grdOpenPost.Dat aSource = dsOpenPost
grdOpenPost.Dat aBind()
:) Morten
"AW" <aw****@fr.xrt. com> wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
Hi Morten,

Unfortunately, you can't use more than one column as a data source for an
HyperLinkColumn .

However, if the object that you're binding to your DataGrid is a DataTable, there's a trick: you can add a new computed column to the DataTable, and
bind this column to your HyperLinkColumn .

In your ASPX, write:
<asp:HyperLinkC olumn DataNavigateUrl Field="InvoNo"
DataNavigateUrl FormatString="I nvo.aspx?{0}" DataTextField=" Computed"
HeaderText="Inv o No.">

and in your CodeBehind, use:
DataSet ds = new DataSet();

sqlDataAdapter2 .Fill(ds);

DataTable t = ds.Tables[0];

DataColumn dc = new DataColumn("Com puted");

dc.Expression=" Id=' + InvoNo + '&id2="+ Request.QuerySt ring("custno") + "'";
t.Columns.Add(d c);

DataGrid1.DataS ource=ds;

DataGrid1.DataB ind();
--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net

Nov 17 '05 #3
After a tortal 'Read-down' og my pages and code I have reconsidered and done
some redisign and found that Request.QuerySt ring("custno") belongs in a
session variable.

No more agony.

Thank.

"Morten" <mk intelle (no)> wrote in message
news:3f******** @news.broadpark .no...
Hi.

After a while I finaly discovered how to use HyperLinkColumn s.
What I can't find is how to send mote than one "value" like
page.aspx?id1&i d2!!!

<asp:HyperLinkC olumn DataNavigateUrl Field="InvoNo"
DataNavigateUrl FormatString="I nvo.aspx?Id={0} " DataTextField=" InvoNo"
HeaderText="Inv o No.">
<HeaderStyle HorizontalAlign ="Left"></HeaderStyle>
<ItemStyle HorizontalAlign ="Left"></ItemStyle>
</asp:HyperLinkCo lumn>

I also need to send: ID2=Request.Que ryString("custn o")
??
Invo.aspx?Id={0 }&ID2=Request.Q ueryString("cus tno")
Thanks...

Morten

Nov 17 '05 #4

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

Similar topics

0
4847
by: Jongmin | last post by:
Hi! I am making HyperLinkColumn in datagrid. It is simple to make the hyerlinkcolumn with one datafield. <asp:HyperLinkColumn Text="NAME" DataNavigateUrlField="NAME" DataNavigateUrlFormatString="http://www.aaa.com?Name={0}" SortExpression="NAME" />
1
1450
by: Dmitri Manushin | last post by:
Hi all, i have HyperLinkColumn in DataGrid <asp:HyperLinkColumn DataNavigateUrlField="PostID" DataNavigateUrlFormatString="http://localhost/forum/posts.aspx?id={0}" DataTextField="Subject" HeaderText="ôÅÍÁ"> This code work, but when i do next <asp:HyperLinkColumn DataNavigateUrlField="PostID" DataNavigateUrlFormatString="http://manushind/forum/posts.aspx?id={0}?page=1
3
3380
by: SStory | last post by:
I have a style sheet for my site. It has various classes in it. It has <A: styles defined for all anchor tags. I have a datagrid in ASP.NET with a stylesheet linked to the page. It defines links a yellow which is what I normally won't but in this case I want to override the link color and can't seem to do it. I set the forecolor in itemstyle prop. But it doesn't work.
3
3376
by: TJS | last post by:
how can I encrypt the querystring values for a HyperLinkColumn ? in example below I would like to encrypt value for field1 ====================================================== <asp:HyperLinkColumn Text="View" DataNavigateUrlField="field1" DataNavigateUrlFormatString="page.aspx?idx={0}"></asp:HyperLinkColumn>
0
1188
by: Luis E Valencia | last post by:
Read from above to top. I didnt understand. This is the code that fills that datagrid Public Sub pasar(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
10
1759
by: tshad | last post by:
I have a Datagrid with a column: <asp:HyperLinkColumn DataTextField="JobTitle" DataNavigateUrlField="PositionID" DataNavigateUrlFormatString="AddNewPositions.aspx?PositionID={0}" HeaderText="Job Title" Visible="True" SortExpression="JobTitle"/>
1
1068
by: Tim::.. | last post by:
Hi... Can someone please tell me how I get the following values from the datatable below into a datagrid??? I want to use template columns so I can minipulate the data but don't know how to get the values into the templated columns... I tried... Container.DataItem, "givenName"
1
1475
by: Craig | last post by:
I have a datagrid with a couple of columns. Right now, I'm setting assigning the dataview to the datasource. For the HyperLinkColumn.... <asp:HyperLinkColumn DataNavigateUrlField="ATTACHMENTDOWNLOADURL" Text="Download" HeaderText="Quick Links" SortExpression="FILEPATH"/> The field in the dataview is something like: "/mypath/tomyfile/hello.txt" the link gets set to http://localhost/mypath/tomyfile/hello.txt" I want the base of the...
2
1058
by: serge calderara | last post by:
Dear all, I have a dataset bound to a datagrid object. One of this grid column is an HyperLinkColumn template defined as follow : <asp:HyperLinkColumn HeaderText="ID" DataTextField="ID" DataNavigateUrlField="ID" DataNavigateUrlFormatString="Event.aspx?ReelId={0}"> </asp:HyperLinkColumn> Is it possible to catch the clik event of the hypelinkColumn befreo the
0
9820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10551
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5828
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.