I'm not familiar with Arrays at all hence I need help on how to exclude a value from being added into the below variable:
Dim columns = PL_DGV.Columns.Cast(Of DataGridViewColumn)().ToArray()
I was thinking about the .Where() function but unsure how to apply it to the above array of DataGridViewColumns:
Dim columns = PL_DGV.Columns.Cast(Of DataGridViewColumn)().Where("Name <> column_name").ToArray()
I might need to exclude few values from it therefore it would be nice if maybe the column_name bit could be a variable of multiple values?
Wheremethod doesn't accept aStringand any research on the web would have shown you that. Look for examples of its use and do what they do. You can probably click it in the code editor and press F1 to go straight to the documentation and find examples there. You should be providing a Lambda expression so that is the next thing you should be researching.Wherehas to be used, I simply tried it because I remember seeing it somewhere in some code and also because I know SQL well and its a common syntax to use whenever filtering values, which is kind of what I am trying to do - filter values before they are assigned to thecolumnsvariable. I have tried researching how to remove/filter/exclude a value from an array, or even converting to string then back to array after removing value, none worked hence the question on here...Wheremethod is definitely the right option in that case, but you're not calling it correctly. You need to provide an appropriate Lambda expression, so you should find out what that would be. That Lambda can be anything that evaluates to aBoolean, so there's no requirement to use an equality comparison. If you want to determine whether a value is contained in a list of values then you can useContainsin your Lambda.