Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
UltraGrid and Making Multi-Line Queries one line.
posted

Hi,

I'm wondering if there is a way to 'wordwrap' something in a cell. Here is what I'm trying to do. I click a button and it opens up a button with an ultragrid on it. It shows the user past SQL they've done. However, if the SQL is like this :

Select *

From History

Where Dog = Collie

The only thing the table shows is the first line (Unless you run over it with the mouse).  Is there a way to sort of word wrap it into the following : Select * From History Where Dog = Collie

I've tried using the following code which I thought would work but it doesn't.

[Code happens that calls upon the loading of the table]

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(Replace(CAST(sql AS NCHAR(1000)), unicode(10), ''), unicode(13), ''), '  ', ' ') AS ONESQL FROM HISTORY WHERE NODETYPE = '" & ApplicationConstants.QUERY_DATA & "' ORDER BY QUERYDATE DESC"

dt = conn.ExecuteQueryDT(strSQL)

Return dt

End Function

This calls back the Query Date (works!), the original SQL (Works), but the third column ONESQL doesn't show all the SQL on one line. Just does the normal thing.

 

Any help you can offer would be appreciated. Any reading materials or if you suggest an easier method, that would also be appreciated!

  • 17259
    Offline posted

    You can set the cell to multiline:

    column.CellMultiLine = Infragistics.Win.DefaultableBoolean.True