DataGrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vinay

    #1

    DataGrid

    Hi,

    I am binding a dataset to DataGrid.

    I have a field which returns decimal values.

    Ex: 0.23

    In dataGrid it is showing only 0 insted of 0.23!

    How to format it to get the decimal value??

    Thanks
    vinay
  • Duppypog

    #2
    Re: DataGrid

    In the Property Builder of the DataGrid control, select the correct Bound
    Column, then in the "Data formatting expression" box add "{0:D2}.

    For more information on formatting data, search on the DataFormatStrin g
    Property.
    lds



    "vinay" <vinay.pathi@co rpusinc.com> wrote in message
    news:085c01c350 6b$bca07160$a00 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > I am binding a dataset to DataGrid.
    >
    > I have a field which returns decimal values.
    >
    > Ex: 0.23
    >
    > In dataGrid it is showing only 0 insted of 0.23!
    >
    > How to format it to get the decimal value??
    >
    > Thanks
    > vinay[/color]


    Comment

    • vinay

      #3
      Re: DataGrid

      I tried it, it gives me error while binding.
      Exception Details: System.FormatEx ception: Format
      specifier was invalid.

      Thx
      vinay[color=blue]
      >-----Original Message-----
      >In the Property Builder of the DataGrid control, select[/color]
      the correct Bound[color=blue]
      >Column, then in the "Data formatting expression" box[/color]
      add "{0:D2}.[color=blue]
      >
      >For more information on formatting data, search on the[/color]
      DataFormatStrin g[color=blue]
      >Property.
      >lds
      >
      >
      >
      >"vinay" <vinay.pathi@co rpusinc.com> wrote in message
      >news:085c01c35 06b$bca07160$a0 01280a@phx.gbl. ..[color=green]
      >> Hi,
      >>
      >> I am binding a dataset to DataGrid.
      >>
      >> I have a field which returns decimal values.
      >>
      >> Ex: 0.23
      >>
      >> In dataGrid it is showing only 0 insted of 0.23!
      >>
      >> How to format it to get the decimal value??
      >>
      >> Thanks
      >> vinay[/color]
      >
      >
      >.
      >[/color]

      Comment

      • Duppypog

        #4
        Re: DataGrid

        {0:D2} is the example straight out of the Visual Studio.NET Help file. Are
        you sure you typed it in correctly?



        "vinay" <vinay.pathi@co rpusinc.com> wrote in message
        news:014601c350 6f$9648ef20$a30 1280a@phx.gbl.. .[color=blue]
        > I tried it, it gives me error while binding.
        > Exception Details: System.FormatEx ception: Format
        > specifier was invalid.
        >
        > Thx
        > vinay[color=green]
        > >-----Original Message-----
        > >In the Property Builder of the DataGrid control, select[/color]
        > the correct Bound[color=green]
        > >Column, then in the "Data formatting expression" box[/color]
        > add "{0:D2}.[color=green]
        > >
        > >For more information on formatting data, search on the[/color]
        > DataFormatStrin g[color=green]
        > >Property.
        > >lds
        > >
        > >
        > >
        > >"vinay" <vinay.pathi@co rpusinc.com> wrote in message
        > >news:085c01c35 06b$bca07160$a0 01280a@phx.gbl. ..[color=darkred]
        > >> Hi,
        > >>
        > >> I am binding a dataset to DataGrid.
        > >>
        > >> I have a field which returns decimal values.
        > >>
        > >> Ex: 0.23
        > >>
        > >> In dataGrid it is showing only 0 insted of 0.23!
        > >>
        > >> How to format it to get the decimal value??
        > >>
        > >> Thanks
        > >> vinay[/color]
        > >
        > >
        > >.
        > >[/color][/color]


        Comment

        • vinay

          #5
          Re: DataGrid

          This one worked for me
          {0:0.00}
          [color=blue]
          >-----Original Message-----
          >{0:D2} is the example straight out of the Visual[/color]
          Studio.NET Help file. Are[color=blue]
          >you sure you typed it in correctly?
          >
          >
          >
          >"vinay" <vinay.pathi@co rpusinc.com> wrote in message
          >news:014601c35 06f$9648ef20$a3 01280a@phx.gbl. ..[color=green]
          >> I tried it, it gives me error while binding.
          >> Exception Details: System.FormatEx ception: Format
          >> specifier was invalid.
          >>
          >> Thx
          >> vinay[color=darkred]
          >> >-----Original Message-----
          >> >In the Property Builder of the DataGrid control, select[/color]
          >> the correct Bound[color=darkred]
          >> >Column, then in the "Data formatting expression" box[/color]
          >> add "{0:D2}.[color=darkred]
          >> >
          >> >For more information on formatting data, search on the[/color]
          >> DataFormatStrin g[color=darkred]
          >> >Property.
          >> >lds
          >> >
          >> >
          >> >
          >> >"vinay" <vinay.pathi@co rpusinc.com> wrote in message
          >> >news:085c01c35 06b$bca07160$a0 01280a@phx.gbl. ..
          >> >> Hi,
          >> >>
          >> >> I am binding a dataset to DataGrid.
          >> >>
          >> >> I have a field which returns decimal values.
          >> >>
          >> >> Ex: 0.23
          >> >>
          >> >> In dataGrid it is showing only 0 insted of 0.23!
          >> >>
          >> >> How to format it to get the decimal value??
          >> >>
          >> >> Thanks
          >> >> vinay
          >> >
          >> >
          >> >.
          >> >[/color][/color]
          >
          >
          >.
          >[/color]

          Comment

          Working...