Results 1 to 4 of 4

Thread: Table and Word Wrapping in Cells

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    36

    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.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Table and Word Wrapping in Cells

    Quote Originally Posted by William Burrus View Post
    I hope this makes sense.
    vaguely

    ok. are you using a datagridview to display your table?

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    36

    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.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Table and Word Wrapping in Cells

    assuming you were using a dgv. i'd start with the cell_formatting event

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width