Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > DataGrid Help

Reply
Thread Tools

DataGrid Help

 
 
VLAD
Guest
Posts: n/a
 
      01-06-2004
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?
 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      01-06-2004
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" <(E-Mail Removed)> wrote in message news:%23f0$(E-Mail Removed)...
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?
 
Reply With Quote
 
 
 
 
scorpion53061
Guest
Posts: n/a
 
      01-06-2004
Alvin,

"Alvin Bruney" <vapor at steaming post office> wrote in message
news:OpHg%23$(E-Mail Removed)...
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.


 
Reply With Quote
 
Alvin Bruney
Guest
Posts: n/a
 
      01-06-2004
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 http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Alvin,
>
> "Alvin Bruney" <vapor at steaming post office> wrote in message
> news:OpHg%23$(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid help on Datagrid's SelectedIndexChanged event Eric ASP .Net Web Controls 1 05-21-2005 05:15 AM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments