View Full Version : dynamic links

Mar 09, 2015, 2:32 PM
I'm generating a grid by the code behind of dynamic way, this grid have HyperLinkColumn and would like to know a way to spend links so that each line had a different link. If I put the link dataIndex as it will only bring the link, I need to show any text with different link on each line.

Mar 09, 2015, 7:54 PM
Please, take a look on example http://examples.ext.net/#/GridPanel/ColumnModel/HyperlinkColumn/

or post your code for more help...

Mar 09, 2015, 8:34 PM
Thank you for answering.

my research in the database returns more than one link, so when I do "for" to mount the column, it passes once and assigns the same link to the entire column.


Dim dt As New DataTable
Dim list As New List(Of ColumnBase)
Dim listContOcorr As New List(Of Object)

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
End If

End Sub

Public Sub buildGrid()

dt = SearchStrore()

Dim sizeDt As Integer
Dim numeroModels As String = "1"

sizeDt = dt.Columns.Count

For i As Integer = 0 To sizeDt - 1
Me.buildModel(dt.Columns(i).ColumnName, i)



End Sub

Public Sub AddField(ByVal field As ModelField)


End Sub

Public Sub buildModel(ByVal nomeModel As String, ByVal indice As Integer)

Me.AddField(New ModelField(nomeModel.ToString))

Dim colunaMes As String = nomeModel.Split("/")(0)

Dim ano As String
Dim mes As String

ano = nomeModel.Split("/")(0)
mes = nomeModel.Split("/")(1)

Dim coluna As New Ext.Net.HyperlinkColumn
coluna.Width = "70"
coluna.Align = Alignment.Center
coluna.ID = "Col" & nomeModel.Replace("/", "")
coluna.Text = nomeModel
coluna.DataIndex = nomeModel
coluna.Filterable = True

'coluna.HrefPattern = here I get my link


End Sub

Public Sub buildStore()

Me.storeOcorrencia.DataSource = dt

End Sub

Mar 11, 2015, 1:01 PM
the "HyperLinkColumn" component enables the configuration of one link. Try using a "CustomColumn", see example http://examples.ext.net/#/GridPanel/Miscellaneous/Custom_Column/ and manually create links from html tags.

May 18, 2015, 2:48 PM
I created a custom column , as you said, with one record per link and used the dataindexHref to assign links to the HyperLinkColumn