![]() |
insert a hyperlink column to datgrid
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() |
Re: insert a hyperlink column to datgrid
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" <nospam@here.com> wrote in message news:enQrpTP$DHA.4060@TK2MSFTNGP10.phx.gbl... > 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() > > |
| All times are GMT. The time now is 09:56 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.