Datagrid Question

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

    #1

    Datagrid Question

    is it possible with a datagrid to bind it to a table that has a column that
    is an integer and then when the datagrid is display, I can tell it that if
    the field is a 1, then display this value, if a 2 display this value and so
    on?


  • William Ryan  eMVP

    #2
    Re: Datagrid Question

    Yes, you can create an expression column and set the expression such that if
    the column1 = 1 then the expression should equal two. You are going to need
    to nest some iif statements, where you start with the outermost expression,
    basically you'll have an IIF inside of an IIF for each additional condition
    you want. I can walk you through it specifically if you can't do it after
    reading my article, but just use IIF as your expression.

    Let me know if you have any questions.

    Bill
    "William Gower" <w_gower@hotmai l.com> wrote in message
    news:Owa3xRNKEH A.3492@TK2MSFTN GP09.phx.gbl...[color=blue]
    > is it possible with a datagrid to bind it to a table that has a column[/color]
    that[color=blue]
    > is an integer and then when the datagrid is display, I can tell it that if
    > the field is a 1, then display this value, if a 2 display this value and[/color]
    so[color=blue]
    > on?
    >
    >[/color]


    Comment

    • William Ryan  eMVP

      #3
      Re: Datagrid Question

      Yes, you can create an expression column and set the expression such that if
      the column1 = 1 then the expression should equal two. You are going to need
      to nest some iif statements, where you start with the outermost expression,
      basically you'll have an IIF inside of an IIF for each additional condition
      you want. I can walk you through it specifically if you can't do it after
      reading my article, but just use IIF as your expression.

      Let me know if you have any questions.

      Bill
      "William Gower" <w_gower@hotmai l.com> wrote in message
      news:Owa3xRNKEH A.3492@TK2MSFTN GP09.phx.gbl...[color=blue]
      > is it possible with a datagrid to bind it to a table that has a column[/color]
      that[color=blue]
      > is an integer and then when the datagrid is display, I can tell it that if
      > the field is a 1, then display this value, if a 2 display this value and[/color]
      so[color=blue]
      > on?
      >
      >[/color]


      Comment

      • Cor Ligthert

        #4
        OT

        Hi Bill,

        Did you know that there are some statements that the most VB.net newsgroup
        regulars do almost all not like, however they tell it of course never to the
        C# regulars.

        One of them IIF

        A very old and a very a scripting language command.

        :-)

        Cor


        Comment

        • Cor Ligthert

          #5
          OT

          Hi Bill,

          Did you know that there are some statements that the most VB.net newsgroup
          regulars do almost all not like, however they tell it of course never to the
          C# regulars.

          One of them IIF

          A very old and a very a scripting language command.

          :-)

          Cor


          Comment

          Working...