Hello,
I am binding a bindingsource to a datagridview and I have set the bindingsource to filter based on conditions.
However, I think that the criteria i have is too complex to put in the filter.
Is there an easier method to use.
I will try my best to explain the criteria:
AssemblyID, category, Type
Type (components, equipment, software)
Category - software (Office, DB, Anti-virus)
Category - components(memory, processor, input)
Category - equipment(printers, display, keyboard)
For example the customer could select from some combo boxes the category that want to display for that type.
I have tried doing something with the string.format e.g.
The above didn't work, so sure that filter can handle it.
Another problem I have is that i need to display many combinations for instance the user could select either software, components, or software. and the individual category for each one.
For example the user could select to find software and the category CPU, and also display components with category memory.
I think to solve this problem I would have to write many if statements, which I want to avoid doing. Is there a better more cleaner method to do this.
Many thanks for any suggestions.
Steve
I am binding a bindingsource to a datagridview and I have set the bindingsource to filter based on conditions.
However, I think that the criteria i have is too complex to put in the filter.
Is there an easier method to use.
I will try my best to explain the criteria:
AssemblyID, category, Type
Type (components, equipment, software)
Category - software (Office, DB, Anti-virus)
Category - components(memory, processor, input)
Category - equipment(printers, display, keyboard)
For example the customer could select from some combo boxes the category that want to display for that type.
I have tried doing something with the string.format e.g.
Code:
dim criteria as string = string.empty
criteria = string.format(AssemblyID = {0} AND Category = {1} AND Type = {2}",assemblyID, cboSoftware.text, cboType.text)
bindingsource.filter = criteria
dgvParts.datasource = bindingSource
Another problem I have is that i need to display many combinations for instance the user could select either software, components, or software. and the individual category for each one.
For example the user could select to find software and the category CPU, and also display components with category memory.
I think to solve this problem I would have to write many if statements, which I want to avoid doing. Is there a better more cleaner method to do this.
Many thanks for any suggestions.
Steve