Bindingsource Filter help please?
-
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 IfThe 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
-
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 IfThe 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
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[^]
-
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[^]
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
-
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
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[^]
-
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[^]
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