Results 1 to 9 of 9

Thread: datagrid tablestyle

  1. #1

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

    datagrid tablestyle

    in my datagrid I have a field that returns a number I would like to format the number:

    1 = reconciled
    2 = unreconciled

    how do I format that field?

    heres my tablestyle layout for that field...

    VB Code:
    1. Dim grdColStyle10 As New DataGridTextBoxColumn()
    2.         With grdColStyle10
    3.             .HeaderText = "Status"
    4.             .MappingName = "status_ind"
    5.            .Width = 50
    6.             .Alignment = HorizontalAlignment.Center
    7.             .ReadOnly = True
    8.         End With
    It's tough being an unhandled exception...

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

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    There is a Format property of DataGridTextBoxColumn()
    Cant you use that?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    do you have an example?
    It's tough being an unhandled exception...

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

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    VB Code:
    1. Dim grdColStyle10 As New DataGridTextBoxColumn()
    2.         With grdColStyle10
    3.             .HeaderText = "Status"
    4.             .MappingName = "status_ind"
    5.            .Width = 50
    6.             .Alignment = HorizontalAlignment.Center
    7.             .ReadOnly = True
    8.             [b].Format="format string here"[/b]
    9.         End With
    Ofcourse i cant understand what you mean by 1 = reconciled and 2 = unreconciled.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  5. #5

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    the field I'm getting from the database is a status indicater...it is going to have ones and twos in there....


    1 means the record is RECONCILED
    2 means the record is UNRECONCILED


    when I grab the data from the database and put it in my datagrid it comes over as ones and twos...the users have no idea what that means, so I want to format the field with RECONCILED and UNRECONCILED....so, if I use format = ""....where do I run a check to see if it's a 1 or 2?
    It's tough being an unhandled exception...

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

  6. #6
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Oh I see. That seems another story. Is the data on this special field going to be edited by the user or not? if yes what should she enter? 1 /2 or RECONCILED / UNRECONCILED?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  7. #7

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    no they only are going to be able to view the data grid...inquiry only!..
    It's tough being an unhandled exception...

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

  8. #8
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    In that case i think its better to format it when you retrive the data from the database.
    your select statement will look something like this:
    Select IIF(myfield=1,"RECONCILED","UNRECONCILED?") As newfiled From mytable Where .....
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  9. #9

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    cool, thanks luna
    It's tough being an unhandled exception...

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

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