Table and Word Wrapping in Cells
Alright. Here is what we've been trying to do.
We have a button that loads up a form. It opens up a form and there is a Table. Its the history table. Well, the way this table is loaded is we run a function known as HistoryTableSelectSubset. Now, this has worked very fine! Not a problem.
This is our problem. We want three columns in this table. First, QueryDate (WORKS!). Second, SQL (WORKS!). Third, MYNEWCOLUMN (Fail). What we want in this third column is basically the SQL column but with it all word wrapped.
So, instead of seeing only the first line of the SQL on the table if it is written like this:
SELECT *
FROM History
WHERE Dogs = Collie
We'd see this:
SELECT * FROM History WHERE Dogs = Collie
Here is the code we've tried thus far.
Code:
Public Function HistoryTableSelectSubset(ByVal maxRows As Integer, ByVal blnUseTree As Boolean) As DataTable
Dim strSQL As String
Dim dt As New DataTable
InitializeConnection(conn)
conn.MaxRecords = maxRows
strSQL = "SELECT TOP (" & maxRows & ") SQL, QUERYDATE, Replace(Replace(CAST(sql AS NCHAR(1000)), unicode(10), ''), unicode(13), '') AS MYNEWCOLUMNNAME FROM HISTORY WHERE NODETYPE = '" & ApplicationConstants.QUERY_DATA & "' ORDER BY QUERYDATE DESC"
dt = conn.ExecuteQueryDT(strSQL)
Return dt
End Function
Any help would be appreciated. I hope this makes sense.
Re: Table and Word Wrapping in Cells
Quote:
Originally Posted by
William Burrus
I hope this makes sense.
vaguely:D
ok. are you using a datagridview to display your table?
Re: Table and Word Wrapping in Cells
I wish we were.
We're actually using Ultragrid. I've found that they share a lot of the similar aspects when it comes down to it. The coding might be a touch different but I can usually use datagrid coding to figure out how Ultragrid works for something.
Re: Table and Word Wrapping in Cells
assuming you were using a dgv. i'd start with the cell_formatting event