DataGridView

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

    #1

    DataGridView

    Hi,

    I'm having some trouble with my DataGridView. I have it bound to a
    DataTable. One column of the grid is a boolean that says whether a row
    should be visible. There is also a checkbox outside of the grid that toggles
    whether or not the marked rows should be displayed or not.

    The problem happens as follows: The toggle is set so that all rows are
    displayed. The user checks a new row to become invisible. The user stays on
    that row. He then clicks the toggle to hide the marked rows. I get an error
    having to do with the currency manager that says I can't make a row that I'm
    on invisible.

    I was thinking that all I needed to do was put code in the toggle that first
    moved off of that row. I couldn't seem to do that.

    I've never worked with the currency manager before and did not do anything
    with it in this situation.

    Can anyone suggest anything?

    Art
  • Sam Malone

    #2
    Re: DataGridView

    I suspect others will jump in here with a much better answer but I seem to
    recall (dim recesses of my brain) that the "Currency Manager" error is
    bogus. If I'm correct, the real error has nothing to do with "Currency
    Manager" so try looking for an error in saving some other invalid or
    incompatible data. Sorry I can't be of any better assistance but my memory
    fails me at the moment wrt more detail.

    "Art" <Art@discussion s.microsoft.com > wrote in message
    news:46E00BC1-9A22-4673-A2CF-E9D14807A0BD@mi crosoft.com...[color=blue]
    > Hi,
    >
    > I'm having some trouble with my DataGridView. I have it bound to a
    > DataTable. One column of the grid is a boolean that says whether a row
    > should be visible. There is also a checkbox outside of the grid that
    > toggles
    > whether or not the marked rows should be displayed or not.
    >
    > The problem happens as follows: The toggle is set so that all rows are
    > displayed. The user checks a new row to become invisible. The user stays
    > on
    > that row. He then clicks the toggle to hide the marked rows. I get an
    > error
    > having to do with the currency manager that says I can't make a row that
    > I'm
    > on invisible.
    >
    > I was thinking that all I needed to do was put code in the toggle that
    > first
    > moved off of that row. I couldn't seem to do that.
    >
    > I've never worked with the currency manager before and did not do anything
    > with it in this situation.
    >
    > Can anyone suggest anything?
    >
    > Art[/color]


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: DataGridView

      Sam,

      Are you sure of your message. I have the idea that you are mixing this up
      with concurrency.

      For me it sounds obvious that the currency manager comes in trouble if the
      current item is changing. It is showed and has not to be showed.

      However, withouth any code from Art how he makes it invisible there is in my
      opinion no help possible. He describes for me at least his question to
      vague.

      Cor

      "Sam Malone" <the_sam_malone @hotmail.com> schreef in bericht
      news:OqR9ZQTaGH A.3880@TK2MSFTN GP04.phx.gbl...[color=blue]
      >I suspect others will jump in here with a much better answer but I seem to
      >recall (dim recesses of my brain) that the "Currency Manager" error is
      >bogus. If I'm correct, the real error has nothing to do with "Currency
      >Manager" so try looking for an error in saving some other invalid or
      >incompatible data. Sorry I can't be of any better assistance but my memory
      >fails me at the moment wrt more detail.
      >
      > "Art" <Art@discussion s.microsoft.com > wrote in message
      > news:46E00BC1-9A22-4673-A2CF-E9D14807A0BD@mi crosoft.com...[color=green]
      >> Hi,
      >>
      >> I'm having some trouble with my DataGridView. I have it bound to a
      >> DataTable. One column of the grid is a boolean that says whether a row
      >> should be visible. There is also a checkbox outside of the grid that
      >> toggles
      >> whether or not the marked rows should be displayed or not.
      >>
      >> The problem happens as follows: The toggle is set so that all rows are
      >> displayed. The user checks a new row to become invisible. The user
      >> stays on
      >> that row. He then clicks the toggle to hide the marked rows. I get an
      >> error
      >> having to do with the currency manager that says I can't make a row that
      >> I'm
      >> on invisible.
      >>
      >> I was thinking that all I needed to do was put code in the toggle that
      >> first
      >> moved off of that row. I couldn't seem to do that.
      >>
      >> I've never worked with the currency manager before and did not do
      >> anything
      >> with it in this situation.
      >>
      >> Can anyone suggest anything?
      >>
      >> Art[/color]
      >
      >[/color]


      Comment

      • Sam Malone

        #4
        Re: DataGridView

        Firstly, I tried to make it clear that I was anything but sure (I was having
        a senior's moment this morning) but no I'm not confusing it with
        CONcurrency.
        I do (finally) recall that I got that type of error when I was trying to
        store a number like 1234.5678 in a field defined as Double(10,2). In other
        words trying to store a number with four decimal places into a field
        deefined as only allowing two. It wasn't a "Currency" field, per se but I
        guess someone (or something) might have "thought" it was.
        In my case the "number" I was trying to store in the database (10,2) field
        was the result of a calculation.
        For example if I had used something like:

        Dim New_datavalue as double (note no precision defined)
        New_Datavalue = 4/3 - the result of which, of course is
        1.3333333333333 333333333333... (for as many decimal places as VB defaults to
        if you don't specify)
        Update <table>, Set <field> = New_Datavalue - and <field> was defined with
        a precision of 2 decimal places.
        then I would get the error - and it would "claim" to be a Currency Manager
        error.

        However if I rounded the result of the 4/3 math to two decimal places, it
        would work.

        I didn't actually issue the "Update" statement shown above. It was being
        done through a data bound grid. I show the Update statement as an
        illustration of the equivalent of what the grid would accomplish.

        Obviously I have NO idea if this is the cause of Art's problem but sometimes
        it makes sense to try what doesn't make sense since what makes sense isn't
        working. Could it be that, coincident with doing what he knows he's
        attempting to do, there's other data from another cell that is the real
        culprit in a situation like I've described above?



        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
        news:uP90NfTaGH A.4116@TK2MSFTN GP05.phx.gbl...[color=blue]
        > Sam,
        >
        > Are you sure of your message. I have the idea that you are mixing this up
        > with concurrency.
        >
        > For me it sounds obvious that the currency manager comes in trouble if the
        > current item is changing. It is showed and has not to be showed.
        >
        > However, withouth any code from Art how he makes it invisible there is in
        > my opinion no help possible. He describes for me at least his question to
        > vague.
        >
        > Cor
        >
        > "Sam Malone" <the_sam_malone @hotmail.com> schreef in bericht
        > news:OqR9ZQTaGH A.3880@TK2MSFTN GP04.phx.gbl...[color=green]
        >>I suspect others will jump in here with a much better answer but I seem to
        >>recall (dim recesses of my brain) that the "Currency Manager" error is
        >>bogus. If I'm correct, the real error has nothing to do with "Currency
        >>Manager" so try looking for an error in saving some other invalid or
        >>incompatibl e data. Sorry I can't be of any better assistance but my memory
        >>fails me at the moment wrt more detail.
        >>
        >> "Art" <Art@discussion s.microsoft.com > wrote in message
        >> news:46E00BC1-9A22-4673-A2CF-E9D14807A0BD@mi crosoft.com...[color=darkred]
        >>> Hi,
        >>>
        >>> I'm having some trouble with my DataGridView. I have it bound to a
        >>> DataTable. One column of the grid is a boolean that says whether a row
        >>> should be visible. There is also a checkbox outside of the grid that
        >>> toggles
        >>> whether or not the marked rows should be displayed or not.
        >>>
        >>> The problem happens as follows: The toggle is set so that all rows are
        >>> displayed. The user checks a new row to become invisible. The user
        >>> stays on
        >>> that row. He then clicks the toggle to hide the marked rows. I get an
        >>> error
        >>> having to do with the currency manager that says I can't make a row that
        >>> I'm
        >>> on invisible.
        >>>
        >>> I was thinking that all I needed to do was put code in the toggle that
        >>> first
        >>> moved off of that row. I couldn't seem to do that.
        >>>
        >>> I've never worked with the currency manager before and did not do
        >>> anything
        >>> with it in this situation.
        >>>
        >>> Can anyone suggest anything?
        >>>
        >>> Art[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...