Groups | Blog | Home
all groups > asp.net building controls > january 2004 >

asp.net building controls : DataGrid Help


VLAD
1/6/2004 1:42:11 PM
I am using Provider=3DMSIDXS.1 and following code to fill datagrid.=20


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

Dim strCatalog As String

' Catalog Name

strCatalog =3D "TestCatalog"

Dim strQuery As String

If TextBox1.Text <> "" Then

DataGrid1.Visible =3D True

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

Dim connString As String =3D "Provider=3DMSIDXS.1;Integrated Security =
..=3D'';Data Source=3D'" & 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 =3D source

DataGrid1.DataBind()

Else

DataGrid1.Visible =3D 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?
Alvin Bruney
1/6/2004 3:56:48 PM
search this newsgroup for today. i've posted code to add a hyperlink.

--=20
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/2bz4t
[quoted text, click to view]
I am using Provider=3DMSIDXS.1 and following code to fill datagrid.=20


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

Dim strCatalog As String

' Catalog Name

strCatalog =3D "TestCatalog"

Dim strQuery As String

If TextBox1.Text <> "" Then

DataGrid1.Visible =3D True

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

Dim connString As String =3D "Provider=3DMSIDXS.1;Integrated Security =
..=3D'';Data Source=3D'" & 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 =3D source

DataGrid1.DataBind()

Else

DataGrid1.Visible =3D 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?
scorpion53061
1/6/2004 4:01:11 PM
Alvin,

[quoted text, click to view]
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
1/6/2004 5:10:35 PM
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 it@here.com> wrote in
message news:OCkrcCK1DHA.1740@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button