Hi,
I have multiline textbox in which i am getting suggestions from user and storing in MS ACCESS table.
While i displaying in datagrid, the text is not coming as multiline. Instead it was binding as continuous line.
ex: input
test1
test2
test3
in datagrid it is displaying as test1 test2 test3
any idea to resolve this.
9 2404
Hi,
My guess is that you should check the max length for the multiline textbox.
If it's MaxLenght is already greater than the input ,it will show you it in the same line instead of multiple lines.
Hi,
I have multiline textbox in which i am getting suggestions from user and storing in MS ACCESS table.
While i displaying in datagrid, the text is not coming as multiline. Instead it was binding as continuous line.
ex: input
test1
test2
test3
in datagrid it is displaying as test1 test2 test3
any idea to resolve this.
If you want to display the output on different lines (i.e. same as input) in a datagrid, then you will have to use a literal tag .
place the literal inside the template field and bind the output from the db to the literal tag.
Also, see to it that before binding the output to the literal tag, you convert the line breaks to <br/>,
i.e. replace vbCrLf in the string that you are binding to <br/>
Thanks Gomzi,
How can i place litreal tag in template column. I mean where the literal tag is and how can i write codings to convert the line breaks to <br/>
Thanks Gomzi,
How can i place litreal tag in template column. I mean where the literal tag is and how can i write codings to convert the line breaks to <br/>
Try this, -
<asp:GridView ID="GridView1" runat="server">
-
<Columns>
-
<asp:TemplateField>
-
<ItemTemplate>
-
<asp:Literal ID="litsomething" runat="Server"></asp:Literal>
-
</ItemTemplate>
-
</asp:TemplateField>
-
</Columns>
-
</asp:GridView>
-
IN CODE BEHIND,
In page load or whereever you are binding the dataset to a datagrid, run a loop to replace the vbCrLf to <br/> for that column before binding.
THEN, -
-
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
-
If e.Row.RowType = DataControlRowType.DataRow Then
-
CType(e.Row.FindControl("litsomething"), Literal).Text = e.Row.DataItem("yourcolumnname")
-
End If
-
End Sub
-
Hi Gomzi,
sorry for disturbing you.
still i am not clear. i am doing program in asp.net using vb coding.
could you please explain in detail.
Hi Gomzi,
sorry for disturbing you.
still i am not clear. i am doing program in asp.net using vb coding.
could you please explain in detail.
Did you try out the code that i posted last time?
If yes, are you getting any output? or any errors?
Yes. your coding is working properly.
There is no error in it.
But i not got solution for my question.
I need to display multiline content as such. For Ex: if there is 10 lines in database means i need to display as such.But your coding is not helpful for me.
Because it is displaying the content as a single line. It is not considering more than one space and even the next line.
I need to display the following sample coding in datagrid as such.
This is for testing
multiline
option display in
datagrid
<blank spaces>using asp.net
any idea.
Yes. your coding is working properly.
There is no error in it.
But i not got solution for my question.
I need to display multiline content as such. For Ex: if there is 10 lines in database means i need to display as such.But your coding is not helpful for me.
Because it is displaying the content as a single line. It is not considering more than one space and even the next line.
I need to display the following sample coding in datagrid as such.
This is for testing
multiline
option display in
datagrid
<blank spaces>using asp.net
any idea.
Hope you are changing the line feeds from vbCrLf to <br/> .
If you done that too, then I guess posting your code might be helpful in solving the problem.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Alex K. |
last post by:
How do I define multiline column header in DataGrid control?
I need two-line headers for some columns.
Thank you
|
by: Joel Finkel |
last post by:
Folks,
I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry.
The...
|
by: angus |
last post by:
Dear all,
I am using multiline text box(textarea) in datagrid. I've found that i
cannot use a new line character.
is it my problem?
Regards,
Angus
|
by: Tracey |
last post by:
Hi, there
My application requires to display multiline text in the
cell of datagrid. I set the preferredheight of datagrid's
tablsstyle, however, it is fixed. For text longer than
that, the rest...
|
by: jeff maultby |
last post by:
Hi All
I need to display multiple lines of text in same column
in datagrid on display as well as on edit. Want each
row's height to auto size on display according to the nbr
of lines in the...
|
by: ABC |
last post by:
I tried KDNGrid's (www.knowdotnet.com) Multiline textbox column style for
datagrid. It is very good but has some bug on wrong handle datagrid height
that cannot display the scrollbar when a row...
|
by: Mrozu |
last post by:
Help me!
I need to make multiline column in Datagrid. It is ReadOnly. Help me;)
Thx Mrozu
|
by: Aziz |
last post by:
How do I select a DataGrid column (the fourth one) to be multiline so
that when there is more text than can fit horizontally, the text will
carry on in the next line and automatically change the...
|
by: evilson |
last post by:
Hi,
I have two textbox, one of the textbx is is set to multiline. Problem is when i try to insert the value of the multiline textbox to the datagridview, it never work. The datagrid's warpmode is...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |