Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > insert a hyperlink column to datgrid

Reply
Thread Tools

insert a hyperlink column to datgrid

 
 
TJS
Guest
Posts: n/a
 
      02-27-2004
how can I programmatically insert an optional hyperlink column into my
datagrid which is currently being created from design tags

I am trying example found as below but with no success. what am I missing?


==============code====================
.... create dataset ...

MyDataGrid.AutoGenerateColumns = false

if condition = true then
' Add a hyperlink column
Dim hc1 as new HyperLinkColumn
hc1.DataTextField = "StringValue"
hc1.DataTextFormatString = "Show details for {0}"
hc1.DataNavigateUrlField="IntegerValue"
hc1.DataNavigateUrlFormatString="details.aspx?ID={ 0}"
hc1.HeaderText="Show me more"
MyDataGrid.Columns.Add (hc1)
end if

MyDataGrid.DataSource = ds
MyDataGrid.DataBind()


 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      03-02-2004
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"TJS" <(E-Mail Removed)> wrote in message
news:enQrpTP$(E-Mail Removed)...
> how can I programmatically insert an optional hyperlink column into my
> datagrid which is currently being created from design tags
>
> I am trying example found as below but with no success. what am I

missing?
>
>
> ==============code====================
> ... create dataset ...
>
> MyDataGrid.AutoGenerateColumns = false
>
> if condition = true then
> ' Add a hyperlink column
> Dim hc1 as new HyperLinkColumn
> hc1.DataTextField = "StringValue"
> hc1.DataTextFormatString = "Show details for {0}"
> hc1.DataNavigateUrlField="IntegerValue"
> hc1.DataNavigateUrlFormatString="details.aspx?ID={ 0}"
> hc1.HeaderText="Show me more"
> MyDataGrid.Columns.Add (hc1)
> end if
>
> MyDataGrid.DataSource = ds
> MyDataGrid.DataBind()
>
>



 
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
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
How to assign a column of URLs to Hyperlink Column of a DataGrid c =?Utf-8?B?ZGF2aWQ=?= ASP .Net 11 07-17-2006 07:20 PM
HyperLink Column and Button Column in a DataGrid =?Utf-8?B?V2FyYW4=?= ASP .Net 0 08-09-2005 12:00 AM
Totaling a column in Datgrid Atif Jalal ASP .Net 2 01-24-2004 10:40 PM



Advertisments