datagridview multiline textbox?

COMPCAD

New member
Joined
Jun 2, 2009
Messages
1
Programming Experience
Beginner
:DI have a database that has 13 columns but there is one column I need help with within a project I am doing in VB.NET. I have a datagridview that calls the database and I also have a multiline textbox that is bound to the datagridview which is called CallNumber as you scroll down the database the data appears as such in one of the cells:

KF 123 D456 1890

I am trying to get the data to look as such in the multiline textbox when you scroll down the datagridview:

KF
123
D456
1890

I was given this code but I do not know where to put it within my code should it be placed in the form_load or does it need its own Private Sub here is the code:

Uhm could you try this on DataSourceChange event:

for each row as DataGridviewRow in yourDataGridView.Rows
row.cells("CALLNUMBER")=row.cells("CALLNUMBER").value.tostring().replace(Chr(32), Chr(13)+Chr(10))
next
 
Back
Top