Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Bindingsource Filter help please?

Bindingsource Filter help please?

Scheduled Pinned Locked Moved Visual Basic
helpdebuggingtutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chrispie123
    wrote on last edited by
    #1

    Hello I have a problem with a bindingsource. I have a dataset of values bind to text and combo boxes on the form for the user to edit. The combo boxes are bind to another dataset. I need to filter the lookup values in the combo boxes. I use the filter on the bindingsource of the combo boxes. This filter needs to be dynamic as certain fields filter another… My filter looks something like

    BS.Filter = "Status='1'OR Field = '" & value

    Now the data filter correct and everything… But when I want to exit the field I check for the following

    If ds.table.GetChanges IsNot Nothing Then
    PromtUnsavedChanges()
    End If

    The use is prompted to save the data even if they did not change any fields. If I remove the filter everything works fine. I endedit in debug mode before and after the filter is assigned and it is after the filter is assigned that the problem happens… Does anyone know why this is happening and how to fix it. It will be highly appreciated. I have many problems with this. Thanks, Christiaan

    W 1 Reply Last reply
    0
    • C Chrispie123

      Hello I have a problem with a bindingsource. I have a dataset of values bind to text and combo boxes on the form for the user to edit. The combo boxes are bind to another dataset. I need to filter the lookup values in the combo boxes. I use the filter on the bindingsource of the combo boxes. This filter needs to be dynamic as certain fields filter another… My filter looks something like

      BS.Filter = "Status='1'OR Field = '" & value

      Now the data filter correct and everything… But when I want to exit the field I check for the following

      If ds.table.GetChanges IsNot Nothing Then
      PromtUnsavedChanges()
      End If

      The use is prompted to save the data even if they did not change any fields. If I remove the filter everything works fine. I endedit in debug mode before and after the filter is assigned and it is after the filter is assigned that the problem happens… Does anyone know why this is happening and how to fix it. It will be highly appreciated. I have many problems with this. Thanks, Christiaan

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Using debugger, see what ds.table.GetChanges returns. If it isn't Nothing you should get a datatable containing all the modifications. When examining it's rows, perhaps you would get a hint what rows are interpreted as changed or why.

      The need to optimize rises from a bad design.My articles[^]

      C 1 Reply Last reply
      0
      • W Wendelius

        Using debugger, see what ds.table.GetChanges returns. If it isn't Nothing you should get a datatable containing all the modifications. When examining it's rows, perhaps you would get a hint what rows are interpreted as changed or why.

        The need to optimize rises from a bad design.My articles[^]

        C Offline
        C Offline
        Chrispie123
        wrote on last edited by
        #3

        Goood Morning Thanks for your reply. I did check that. And the values before (original) and (proposed) are the same. I think what happens (might be wrong) when the filter is applied the value gets update by the same value again. Do you know if there is away to check which value changed (that it is complaining about) in the row? Thanks, Christiaan

        W 1 Reply Last reply
        0
        • C Chrispie123

          Goood Morning Thanks for your reply. I did check that. And the values before (original) and (proposed) are the same. I think what happens (might be wrong) when the filter is applied the value gets update by the same value again. Do you know if there is away to check which value changed (that it is complaining about) in the row? Thanks, Christiaan

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Seems that we're on the same timezone :) The indexer in datarow has an overload which I think you could use. See: DataRow.Item Property (DataColumn, DataRowVersion)[^]. Using that, you can compare the current value of a column in a row and the original value which you have in the DataRow.

          The need to optimize rises from a bad design.My articles[^]

          C 1 Reply Last reply
          0
          • W Wendelius

            Seems that we're on the same timezone :) The indexer in datarow has an overload which I think you could use. See: DataRow.Item Property (DataColumn, DataRowVersion)[^]. Using that, you can compare the current value of a column in a row and the original value which you have in the DataRow.

            The need to optimize rises from a bad design.My articles[^]

            C Offline
            C Offline
            Chrispie123
            wrote on last edited by
            #5

            Hi Everyone Sorry for the delay but I was on leave for 2 days. For some reason when I apply the filter on the bindingsource it changes my data. I did look at all the original / current / proposed values and they are all the same.... Don't know why this happens. The work around that I did was, after I apply the filter, I Accept the changes. Thanks for your help... Christaan

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups