Results 1 to 2 of 2

Thread: datagrid stylesheet

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    datagrid stylesheet

    In my SQL I get a value from calculating two fields. I want to place this value in my datagrid. I'm having trouble mapping it in my dg-stylesheet.

    VB Code:
    1. Dim cmdView As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("select check_no, purchase_date, vendor_payee, check_amt, " & _
    2.         [B]"(check_amt-returned_amt) as purchase_amt[/B], returned_amt, approver_id, " & _
    3.         "from pccr.pccr_check_header, pccr.pccr", objCon)
    4.  
    5. Dim grdColStyle5 As New DataGridTextBoxColumn()
    6.         With grdColStyle5
    7.             .HeaderText = "Purchase Amt"
    8.             .MappingName = "purchase_amt"
    9.             .Format = "$#.##"
    10.             .Width = 77
    11.             .Alignment = HorizontalAlignment.Center
    It's tough being an unhandled exception...

    ___________
    VB.NET 2008
    VB.NET 2010
    ORACLE 11g
    CRYSTAL 11

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: datagrid stylesheet

    VB Code:
    1. Dim cmdView As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("select check_no, purchase_date, vendor_payee, check_amt, " & _
    2.         "(check_amt-returned_amt) as purchase_amt, returned_amt, approver_id, " & _
    3.         "from pccr.pccr_check_header, pccr.pccr", objCon)
    4.  
    5. dim ds as new dataset
    6. cmdView.Fill(ds, "purchase_amt")
    7.  
    8. Dim ts1 As New DataGridTableStyle
    9.  
    10. ts1.MappingName = "purchase_amt"
    11. ts1.AlternatingBackColor = Color.LightBlue
    12.  
    13.  
    14. Dim grdColStyle5 As New DataGridTextBoxColumn()
    15.  
    16.         With grdColStyle5
    17.             .HeaderText = "Purchase Amt"
    18.             .MappingName = "purchase_amt"
    19.             .Format = "$#.##"
    20.             .Width = 77
    21.             .Alignment = HorizontalAlignment.Center
    22.     end with
    23.  
    24. Me.DataGrid1.TableStyles.Clear()
    25. Me.DataGrid1.TableStyles.Add(ts1)
    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

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