dynamic links

  1. #1

    dynamic links

    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.
    Last edited by gmarcinari; Mar 09, 2015 at 8:47 PM.
  2. #2
    Please, take a look on example http://examples.ext.net/#/GridPanel/...perlinkColumn/

    or post your code for more help...
    Last edited by lrossism; Mar 09, 2015 at 8:57 PM.
  3. #3

    dynamic links

    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.

    Code:

     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
                buildGrid()
            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)
            Next
    
            gridOcorrenciaMes.Reconfigure(list)
    
            Me.buildStore()
    
        End Sub
    
        Public Sub AddField(ByVal field As ModelField)
    
            Me.storeOcorrencia.Model(0).Fields.Add(field)
    
        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
    
            list.Add(coluna)
    
        End Sub
    
        Public Sub buildStore()
    
            Me.storeOcorrencia.DataSource = dt
            Me.storeOcorrencia.DataBind()
    
        End Sub
    Last edited by gmarcinari; Mar 10, 2015 at 12:59 PM.
  4. #4
    the "HyperLinkColumn" component enables the configuration of one link. Try using a "CustomColumn", see example http://examples.ext.net/#/GridPanel/...Custom_Column/ and manually create links from html tags.
  5. #5

    Thanks

    I created a custom column , as you said, with one record per link and used the dataindexHref to assign links to the HyperLinkColumn

Similar Threads

  1. [CLOSED] [#623] Links to example pages
    By ALobpreis in forum 1.x Help
    Replies: 5
    Last Post: Dec 24, 2014, 12:43 AM
  2. Replies: 0
    Last Post: Apr 06, 2012, 12:11 PM
  3. Links Inside GridPanel
    By marcmvc in forum 1.x Help
    Replies: 1
    Last Post: May 17, 2010, 2:43 PM
  4. [CLOSED] Add JavaScript to Links in HtmlEditor
    By macap in forum 1.x Premium Help
    Replies: 3
    Last Post: Oct 14, 2009, 10:22 AM
  5. Replies: 2
    Last Post: Jul 01, 2009, 5:49 PM

Tags for this Thread

Posting Permissions