DataGrid Help

Discussion in 'ASP .Net Building Controls' started by VLAD, Jan 6, 2004.

  1. VLAD

    VLAD Guest

    I am using Provider=MSIDXS.1 and following code to fill datagrid.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim strCatalog As String

    ' Catalog Name

    strCatalog = "TestCatalog"

    Dim strQuery As String

    If TextBox1.Text <> "" Then

    DataGrid1.Visible = True

    strQuery = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() where FREETEXT('" & TextBox1.Text & "')"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security ..='';Data Source='" & strCatalog & "'"

    Dim cn As New System.Data.OleDb.OleDbConnection(connString)

    Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)

    Dim testDataSet As New DataSet()

    cmd.Fill(testDataSet)



    Dim source As New DataView(testDataSet.Tables(0))

    DataGrid1.DataSource = source

    DataGrid1.DataBind()

    Else

    DataGrid1.Visible = False

    End If

    End Sub

    End Class



    The result I am getting in datagrid is in plain text

    How do I make datagrid to show url in clickable format?
    Or how can I make datagrid item in hyperlink format?
    VLAD, Jan 6, 2004
    #1
    1. Advertising

  2. VLAD

    Alvin Bruney Guest

    search this newsgroup for today. i've posted code to add a hyperlink.

    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    http://tinyurl.com/2bz4t
    "VLAD" <> wrote in message news:%23f0$...
    I am using Provider=MSIDXS.1 and following code to fill datagrid.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim strCatalog As String

    ' Catalog Name

    strCatalog = "TestCatalog"

    Dim strQuery As String

    If TextBox1.Text <> "" Then

    DataGrid1.Visible = True

    strQuery = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() where FREETEXT('" & TextBox1.Text & "')"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security ..='';Data Source='" & strCatalog & "'"

    Dim cn As New System.Data.OleDb.OleDbConnection(connString)

    Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)

    Dim testDataSet As New DataSet()

    cmd.Fill(testDataSet)



    Dim source As New DataView(testDataSet.Tables(0))

    DataGrid1.DataSource = source

    DataGrid1.DataBind()

    Else

    DataGrid1.Visible = False

    End If

    End Sub

    End Class



    The result I am getting in datagrid is in plain text

    How do I make datagrid to show url in clickable format?
    Or how can I make datagrid item in hyperlink format?
    Alvin Bruney, Jan 6, 2004
    #2
    1. Advertising

  3. Alvin,

    "Alvin Bruney" <vapor at steaming post office> wrote in message
    news:OpHg%23$...
    search this newsgroup for today. i've posted code to add a hyperlink.

    Please repost it. I must have missed it. I am in the ADO.NET ng.
    scorpion53061, Jan 6, 2004
    #3
  4. VLAD

    Alvin Bruney Guest

    itemcreated or itemdatabound event handler

    if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)

    {

    //column 1 is an itemtemplate column

    Label lbl = (Label)e.Item.FindControl("Dig");

    if(lbl != null)

    lbl.Text = "<input type=radio name='samegroup' value=" +
    e.Item.Cells[1].Text + ">";

    }


    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    http://tinyurl.com/2bz4t
    "scorpion53061" <Its the end of the world as we know > wrote in
    message news:...
    > Alvin,
    >
    > "Alvin Bruney" <vapor at steaming post office> wrote in message
    > news:OpHg%23$...
    > search this newsgroup for today. i've posted code to add a hyperlink.
    >
    > Please repost it. I must have missed it. I am in the ADO.NET ng.
    >
    >
    Alvin Bruney, Jan 6, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    441
  2. Michael Persaud

    image from sql to datagrid !!! HELP"" HELP

    Michael Persaud, May 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    458
    Mike Bridge
    May 18, 2004
  3. Andreas Klemt
    Replies:
    0
    Views:
    292
    Andreas Klemt
    Oct 8, 2003
  4. dave
    Replies:
    0
    Views:
    99
  5. Eric
    Replies:
    1
    Views:
    189
    Steve Goodyear
    May 21, 2005
Loading...

Share This Page