Results 1 to 2 of 2

Thread: DataGrid Formatting - carriage return after 

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397

    DataGrid Formatting - carriage return after 

    How would you format a datagrid to do a carriage return in the same cell after a certain character?
    Last edited by texas; Aug 25th, 2004 at 02:22 PM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    Austin
    Posts
    397
    dg1 is a datagrid.


    Code:
        Private Sub dg1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dg1.ItemDataBound
            Dim x As Integer
    
            Select Case e.Item.ItemType
                Case ListItemType.Header
                    For x = 3 To 4
                        e.Item.Cells(x).Font.Size = FontUnit.Point(10)
                        e.Item.Cells(x).HorizontalAlign = HorizontalAlign.Center
                    Next
                Case ListItemType.Item, ListItemType.AlternatingItem
                    For x = 3 To 4
                        e.Item.Cells(x).HorizontalAlign = HorizontalAlign.Left
                        e.Item.Cells(x).Text = e.Item.Cells(x).Text.Replace(System.Environment.NewLine, "<br>")
                        e.Item.Cells(x).Text = e.Item.Cells(x).Text.Replace(" ", "&nbsp;")
                        e.Item.Cells(x).Font.Size = FontUnit.Point(10)
                    Next
    
    
            End Select
    
        End Sub

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