DataGrid Help

V

VLAD

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?
 
A

Alvin Bruney

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
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?
 
S

scorpion53061

Alvin,

"Alvin Bruney" <vapor at steaming post office> wrote in message
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.
 
A

Alvin Bruney

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 + ">";

}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top