T
TJS
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()
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()