Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone.!!

I am a fresher in Web Development.
I have one grid view filled with data.
I want to add that same grid view into a normal aspTextbox with
the tabled structure.
I don't want to use FreeTextBox.

any Suggestions,Clarifications or links are welcomed..!!

VB
Dim str As StringBuilder = New StringBuilder()
Dim stringWriter As New StringWriter(str)
Dim _html As HtmlTextWriter = New HtmlTextWriter(stringWriter)
Dim ds As New DataSet()
ds = Session("CNF_Dataset_Mail")
Dim _gv As New GridView()
_gv = New GridView()
_gv.DataSource = Nothing
_gv.DataSource = ds
_gv.DataBind()
_gv.RenderControl(_html)


[edit]Code block moved from comment[/edit]
Posted
Updated 22-Feb-12 5:18am
v3
Comments
kashif Atiq 22-Feb-12 5:07am    
can you clarify that why you want a gridview in a text box?
vaibhav mahajan 22-Feb-12 7:42am    
i have my desired data in a grid.
i want to mail the contents of that grid in a tabled manner.
and the body of the mail is a textbox.
vaibhav mahajan 22-Feb-12 7:44am    
i have tried FreetextBox.
it works too..!!...but after sending the mail it shows in a HTML format to the client.!!
vaibhav mahajan 22-Feb-12 7:45am    
Dim str As StringBuilder = New StringBuilder()
Dim stringWriter As New StringWriter(str)
Dim _html As HtmlTextWriter = New HtmlTextWriter(stringWriter)
Dim ds As New DataSet()
ds = Session("CNF_Dataset_Mail")
Dim _gv As New GridView()
_gv = New GridView()
_gv.DataSource = Nothing
_gv.DataSource = ds
_gv.DataBind()
_gv.RenderControl(_html)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900