formatting the data in a datagrid

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default formatting the data in a datagrid

    Hello,
    I wish to format the data in one of the columns of a
    datagrid so that it does not display more than 3 decimal
    places. I have a datagrid call dgjobs and I have the
    following code.

    nb cm is a currency manager
    Dim i As Integer


    ts = New DataGridTableStyle(cm)

    Me.dgjobs.TableStyles.Add(ts)

    ts.GridColumnStyles(11).Width = 50
    ts.GridColumnStyles(11).HeaderText = "B/C"
    ts.GridColumnStyles(11).NullText = ""

    How do I restrict the data in this column 11 to show only
    3 decimal places

    thanx in advance

    Robert
    Robert Batt Guest

  2. Similar Questions and Discussions

    1. Datagrid Formatting
      I am trying to find out if it is possible to format a datagrid to display results in teh following manner; Job: 5453 South Ridge Lane ...
    2. Datagrid cell data formatting
      Hi, I have just finished working on populating a datagrid from an xml file. I am creating a client list with category headers. What I am trying to...
    3. Datagrid cell data formatting - 2
      Ok, I have hit a brick wall here. I am simply trying to set the text in particular cells in particular rows to bold. Actually, I have been able to...
    4. Formatting a datagrid
      Hi, I am working on my first web app that uses a datagrid. I can't seem to find good examples of formatting the grid the way you can in a Windows...
    5. datagrid codebehind formatting
      What if columns are not boundColumns? "Teemu Keiski" <joteke@aspalliance.com> escribió en el mensaje news:eQZRrOYDEHA.1604@TK2MSFTNGP11.phx.gbl...
  3. #2

    Default Re: formatting the data in a datagrid

    Robert,

    Try using the Format property of the column style. e.g.:

    ts.GridColumnStyles(11).Format = "F3"

    HTH,
    Nicole


    "Robert Batt" <robertxxxx@yahoo.com> wrote in message
    news:22be701c38be6$1cf47e70$a601280a@phx.gbl...
    > Hello,
    > I wish to format the data in one of the columns of a
    > datagrid so that it does not display more than 3 decimal
    > places. I have a datagrid call dgjobs and I have the
    > following code.
    >
    > nb cm is a currency manager
    > Dim i As Integer
    >
    >
    > ts = New DataGridTableStyle(cm)
    >
    > Me.dgjobs.TableStyles.Add(ts)
    >
    > ts.GridColumnStyles(11).Width = 50
    > ts.GridColumnStyles(11).HeaderText = "B/C"
    > ts.GridColumnStyles(11).NullText = ""
    >
    > How do I restrict the data in this column 11 to show only
    > 3 decimal places
    >
    > thanx in advance
    >
    > Robert

    Nicole Calinoiu Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139