Null datetime stopping position change

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

    Null datetime stopping position change


    I have a problem with the following if the EndDate on the database is
    Null. Knowing this I can code around it but not knowing it was a very
    frustrating experience!

    endDateTimePick er.DataBindings .Add(new Binding("Value" ,
    MyDB.GameBindin gSource, "EndDate")) ;

    when I move position onto a record with a null enddate the BindingSource
    it moves back again.

    If anyone has a really good solution to the problem please let me know.

    Ta
    Ken

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Null datetime stopping position change

    On Aug 25, 5:18 am, Ken Foskey <rmove.fos...@o ptushome.com.au wrote:
    I have a problem with the following if the EndDate on the database is
    Null.  Knowing this I can code around it but not knowing it was a very
    frustrating experience!
    >
    endDateTimePick er.DataBindings .Add(new Binding("Value" ,
    MyDB.GameBindin gSource, "EndDate")) ;
    >
    when I move position onto a record with a null enddate the BindingSource
    it moves back again.
    >
    If anyone has a really good solution to the problem please let me know.
    >
    Ta
    Ken
    Hi,

    Can you better explain your problem? I got confused with the "move
    back"/forward

    Comment

    • Ken Foskey

      #3
      Re: Null datetime stopping position change

      On Mon, 25 Aug 2008 08:34:02 -0700, Ignacio Machin ( .NET/ C# MVP ) wrote:
      On Aug 25, 5:18 am, Ken Foskey <rmove.fos...@o ptushome.com.au wrote:
      >I have a problem with the following if the EndDate on the database is
      >Null.  Knowing this I can code around it but not knowing it was a very
      >frustrating experience!
      >>
      >endDateTimePic ker.DataBinding s.Add(new Binding("Value" ,
      >MyDB.GameBindi ngSource, "EndDate")) ;
      >>
      >when I move position onto a record with a null enddate the
      >BindingSourc e it moves back again.
      >>
      >If anyone has a really good solution to the problem please let me know.
      >>
      >Ta
      >Ken
      >
      Hi,
      >
      Can you better explain your problem? I got confused with the "move
      back"/forward
      I have 4 rows. Rows 0 and 3 have dates in the EndDate column, Rows 1
      and 2 do not have dates.

      If I set position to 0 or 3 it works correctly, Current changes.

      If I set position to 1 or 2 it very briefly changes (form title bar is
      tied to the database table) and then changes back, if I start at 0 it
      switches to 1 then immediately switches back to 0. If I start at 3 it
      switches to 1 then immediately switches back to 3.

      Once I remove the databinding on the datetime component it works fine.

      This also breaks AddNew because the date time of a number of fields are
      null and I have to set up the record then MoveLast to switch it.

      Thanks
      Ken

      Comment

      Working...