Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Datagrid and hyper link question?

Reply
Thread Tools

Re: Datagrid and hyper link question?

 
 
k-re
Guest
Posts: n/a
 
      06-24-2003
Thank you Tim S. It was a help however i still couldn't figure out how to
fix it? thanx
"Tim S." <(E-Mail Removed)> wrote in message
news:017701c339ad$4d605470$(E-Mail Removed)...
> I understand you need something like:
> <a>href="[myPage]?IN=[in_value]&PON=[pon_Value]>[text]</a>
>
> where the [ ] are variables.
>
> Some ideas:
> 1). In the code behind, you could create a new column and
> programmtically concatenate the values to form that Html
> hyperlink. Then Bind this column to your datagrid.
>
> 2). You could use a template column, and concatenate the
> variables.
>
> 3). If the calculatations get very heavy, You could add a
> linkButton column that calls a function which takes the
> In,Pon, and other vars as inputs and redirects to a
> calculated url.
>
> Tim S.
>
> >-----Original Message-----
> >Hi, I have a xml which is ..
> ><Root>
> ><ProdIDQual>
> > <ON>111111</ON>
> > <PON>121212</PON>
> > <IN>1x1x1x</IN>
> ></ProdIDQual>
> ><ProdIDQual>
> > <ON>222222</ON>
> > <PON>131313</PON>
> > <IN>1z1z1z</IN>
> ></ProdIDQual>
> ></Root>
> >
> >---- I have displayed it on Datagrid with readxml method

> and works fine. I
> >am trying to make a hyperlink in datagrid for another

> page where I need to
> >pass PON and IN from the upper XML. I user

> onItemdatabound event to catch IN
> >but couldn't get the other variable PON.. Is there a way

> to make a link from
> >about XML to pass IN and PON? something like <a
> >href="index.asp?IN=11111&PON=22222222>View</a>
> >
> >Thanks...
> >
> >KB
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
 
Tim S.
Guest
Posts: n/a
 
      06-25-2003
Hello,
Probably the simplest way is #2:
>> 2). You could use a template column, and concatenate the
>> variables.

The steps to do this:
1 - add a template column to your datagrid (if you haven't
used template columns before, just check the MSDN help,
they're really straight forward).
2 - the template column lets you create custom HTML for
each cell, so you could do something like:
<a>href="<%....%>?IN=<%....%>&PON=<%....%>><%....% ></a>

3 - I replaced each [var] with a databind expression,
something like <% ....%> where "..." is the syntax to
databind (look at databinding to a repeater or datagrid in
MSDN for the exact syntax, I don't remember it off the top
of my head).

That should do it.

Tim


>-----Original Message-----
>Thank you Tim S. It was a help however i still couldn't

figure out how to
>fix it? thanx
>"Tim S." <(E-Mail Removed)> wrote in message
>news:017701c339ad$4d605470$(E-Mail Removed)...
>> I understand you need something like:
>> <a>href="[myPage]?IN=[in_value]&PON=[pon_Value]>[text]

</a>
>>
>> where the [ ] are variables.
>>
>> Some ideas:
>> 1). In the code behind, you could create a new column

and
>> programmtically concatenate the values to form that Html
>> hyperlink. Then Bind this column to your datagrid.
>>
>> 2). You could use a template column, and concatenate the
>> variables.
>>
>> 3). If the calculatations get very heavy, You could add

a
>> linkButton column that calls a function which takes the
>> In,Pon, and other vars as inputs and redirects to a
>> calculated url.
>>
>> Tim S.
>>
>> >-----Original Message-----
>> >Hi, I have a xml which is ..
>> ><Root>
>> ><ProdIDQual>
>> > <ON>111111</ON>
>> > <PON>121212</PON>
>> > <IN>1x1x1x</IN>
>> ></ProdIDQual>
>> ><ProdIDQual>
>> > <ON>222222</ON>
>> > <PON>131313</PON>
>> > <IN>1z1z1z</IN>
>> ></ProdIDQual>
>> ></Root>
>> >
>> >---- I have displayed it on Datagrid with readxml

method
>> and works fine. I
>> >am trying to make a hyperlink in datagrid for another

>> page where I need to
>> >pass PON and IN from the upper XML. I user

>> onItemdatabound event to catch IN
>> >but couldn't get the other variable PON.. Is there a

way
>> to make a link from
>> >about XML to pass IN and PON? something like <a
>> >href="index.asp?IN=11111&PON=22222222>View</a>
>> >
>> >Thanks...
>> >
>> >KB
>> >
>> >
>> >.
>> >

>
>
>.
>

 
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
Hyper Link in DataGrid aroraamit81@gmail.com ASP .Net 3 03-03-2006 01:09 PM
Hyper link in Datagrid Meheraj shaik via .NET 247 ASP .Net 1 07-19-2005 10:36 AM
open default MUA with a hyper link Yann.K Python 9 09-08-2004 06:40 PM
Re: open default MUA with a hyper link Jonathan Ellis Python 2 09-06-2004 08:22 AM
hyper link in DataGrid Alexander Kaplunov ASP .Net Web Controls 3 12-18-2003 05:27 PM



Advertisments