Compare ListViewItems with SelectedItems The Next CEO of Stack OverflowIndexOutOfRangeException in VB.NETAndroid - Custom ListView Adapter - Multi Selection remove - Indexoutofbounds - why?C# programmatically change selected item in listviewUsing If Statements to stop loading next from. VB. Edit: Age check now not workingCheckboxes in DataGridGetting SQL data for a report with Time Difference count in VB ASP.NetHow to randomly change wallpaper without duplicates in the seriesChange timeout value for all TableAdapters on a formhow to insert checked items from checkedlistbox to SQL database?Unable to cast ListView to ListViewItem
The Ultimate Number Sequence Puzzle
Is it ok to trim down a tube patch?
How to find image of a complex function with given constraints?
How to Implement Deterministic Encryption Safely in .NET
How do I fit a non linear curve?
Point distance program written without a framework
Scary film where a woman has vaginal teeth
Lucky Feat: How can "more than one creature spend a luck point to influence the outcome of a roll"?
Is fine stranded wire ok for main supply line?
Is there such a thing as a proper verb, like a proper noun?
Towers in the ocean; How deep can they be built?
Why is information "lost" when it got into a black hole?
What flight has the highest ratio of timezone difference to flight time?
how one can write a nice vector parser, something that does pgfvecparseA=B-C; D=E x F;
"Eavesdropping" vs "Listen in on"
Can you teleport closer to a creature you are Frightened of?
Is it convenient to ask the journal's editor for two additional days to complete a review?
Why do we say 'Un seul M' and not 'Une seule M' even though M is a "consonne"
Film where the government was corrupt with aliens, people sent to kill aliens are given rigged visors not showing the right aliens
Do I need to write [sic] when including a quotation with a number less than 10 that isn't written out?
Aggressive Under-Indexing and no data for missing index
What difference does it make using sed with/without whitespaces?
Is dried pee considered dirt?
Graph of the history of databases
Compare ListViewItems with SelectedItems
The Next CEO of Stack OverflowIndexOutOfRangeException in VB.NETAndroid - Custom ListView Adapter - Multi Selection remove - Indexoutofbounds - why?C# programmatically change selected item in listviewUsing If Statements to stop loading next from. VB. Edit: Age check now not workingCheckboxes in DataGridGetting SQL data for a report with Time Difference count in VB ASP.NetHow to randomly change wallpaper without duplicates in the seriesChange timeout value for all TableAdapters on a formhow to insert checked items from checkedlistbox to SQL database?Unable to cast ListView to ListViewItem
I have the following Problem:
I have a ListView with e.g. 5 items:
AAAA (selected)
BBBB
CCCC (selected)
AAAA (selected)
AAAA
And I will check if all the same items are selected (there can also be additional items selected here the CCCC for example) if not then I will get an Msgbox with en error message.
In this example it should get the error messag because one AAAA item is missing.
This is what I have tryed, but in this case it do not work, if you Select an additional Item so only one e.g. AAAA is working. (AAAA and BBBB are not working)
ContainerBox is the ListView
Dim SelectedContainer As Integer = ContainerBox.SelectedItems.Count - 1
Dim ContainerXY As String
Dim ContainerXYAnzahl As Integer
Dim ContainerXYAnzahlAusge As Integer
For i As Integer = 0 To SelectedContainer
ContainerXY = ""
ContainerXYAnzahl = 0
ContainerXYAnzahlAusge = 0
ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring (ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1)
For ii As Integer = 0 To ContainerBox.Items.Count - 1
If ContainerXY = ContainerBox.Items(ii).ToString.Substring (ContainerBox.Items(ii).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahl += 1
End If
Next
For ii = 0 To SelectedContainer
If ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring(ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahlAusge += 1
End If
Next
If ContainerXYAnzahlAusge <> ContainerXYAnzahl Then
PresentPopup("Bitte wählen Sie alle Positionen" & Environment.NewLine & "des Container", AlertType._Error)
Exit Sub
End If
Next
And this is how the ListView Looks like:
vb.net winforms listview
|
show 2 more comments
I have the following Problem:
I have a ListView with e.g. 5 items:
AAAA (selected)
BBBB
CCCC (selected)
AAAA (selected)
AAAA
And I will check if all the same items are selected (there can also be additional items selected here the CCCC for example) if not then I will get an Msgbox with en error message.
In this example it should get the error messag because one AAAA item is missing.
This is what I have tryed, but in this case it do not work, if you Select an additional Item so only one e.g. AAAA is working. (AAAA and BBBB are not working)
ContainerBox is the ListView
Dim SelectedContainer As Integer = ContainerBox.SelectedItems.Count - 1
Dim ContainerXY As String
Dim ContainerXYAnzahl As Integer
Dim ContainerXYAnzahlAusge As Integer
For i As Integer = 0 To SelectedContainer
ContainerXY = ""
ContainerXYAnzahl = 0
ContainerXYAnzahlAusge = 0
ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring (ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1)
For ii As Integer = 0 To ContainerBox.Items.Count - 1
If ContainerXY = ContainerBox.Items(ii).ToString.Substring (ContainerBox.Items(ii).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahl += 1
End If
Next
For ii = 0 To SelectedContainer
If ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring(ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahlAusge += 1
End If
Next
If ContainerXYAnzahlAusge <> ContainerXYAnzahl Then
PresentPopup("Bitte wählen Sie alle Positionen" & Environment.NewLine & "des Container", AlertType._Error)
Exit Sub
End If
Next
And this is how the ListView Looks like:
vb.net winforms listview
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34
|
show 2 more comments
I have the following Problem:
I have a ListView with e.g. 5 items:
AAAA (selected)
BBBB
CCCC (selected)
AAAA (selected)
AAAA
And I will check if all the same items are selected (there can also be additional items selected here the CCCC for example) if not then I will get an Msgbox with en error message.
In this example it should get the error messag because one AAAA item is missing.
This is what I have tryed, but in this case it do not work, if you Select an additional Item so only one e.g. AAAA is working. (AAAA and BBBB are not working)
ContainerBox is the ListView
Dim SelectedContainer As Integer = ContainerBox.SelectedItems.Count - 1
Dim ContainerXY As String
Dim ContainerXYAnzahl As Integer
Dim ContainerXYAnzahlAusge As Integer
For i As Integer = 0 To SelectedContainer
ContainerXY = ""
ContainerXYAnzahl = 0
ContainerXYAnzahlAusge = 0
ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring (ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1)
For ii As Integer = 0 To ContainerBox.Items.Count - 1
If ContainerXY = ContainerBox.Items(ii).ToString.Substring (ContainerBox.Items(ii).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahl += 1
End If
Next
For ii = 0 To SelectedContainer
If ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring(ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahlAusge += 1
End If
Next
If ContainerXYAnzahlAusge <> ContainerXYAnzahl Then
PresentPopup("Bitte wählen Sie alle Positionen" & Environment.NewLine & "des Container", AlertType._Error)
Exit Sub
End If
Next
And this is how the ListView Looks like:
vb.net winforms listview
I have the following Problem:
I have a ListView with e.g. 5 items:
AAAA (selected)
BBBB
CCCC (selected)
AAAA (selected)
AAAA
And I will check if all the same items are selected (there can also be additional items selected here the CCCC for example) if not then I will get an Msgbox with en error message.
In this example it should get the error messag because one AAAA item is missing.
This is what I have tryed, but in this case it do not work, if you Select an additional Item so only one e.g. AAAA is working. (AAAA and BBBB are not working)
ContainerBox is the ListView
Dim SelectedContainer As Integer = ContainerBox.SelectedItems.Count - 1
Dim ContainerXY As String
Dim ContainerXYAnzahl As Integer
Dim ContainerXYAnzahlAusge As Integer
For i As Integer = 0 To SelectedContainer
ContainerXY = ""
ContainerXYAnzahl = 0
ContainerXYAnzahlAusge = 0
ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring (ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1)
For ii As Integer = 0 To ContainerBox.Items.Count - 1
If ContainerXY = ContainerBox.Items(ii).ToString.Substring (ContainerBox.Items(ii).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahl += 1
End If
Next
For ii = 0 To SelectedContainer
If ContainerXY = ContainerBox.SelectedItems(i).ToString.Substring(ContainerBox.SelectedItems(i).ToString.IndexOf(":") + 1) Then
ContainerXYAnzahlAusge += 1
End If
Next
If ContainerXYAnzahlAusge <> ContainerXYAnzahl Then
PresentPopup("Bitte wählen Sie alle Positionen" & Environment.NewLine & "des Container", AlertType._Error)
Exit Sub
End If
Next
And this is how the ListView Looks like:
vb.net winforms listview
vb.net winforms listview
edited Mar 8 at 18:53
LarsTech
70.5k12109161
70.5k12109161
asked Mar 8 at 17:20
NilsNils
55
55
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34
|
show 2 more comments
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34
|
show 2 more comments
1 Answer
1
active
oldest
votes
Try this
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
Dim selectedList = ListView1.SelectedItems.OfType(Of ListViewItem)
Dim desiredList = ListView1.Items.OfType(Of ListViewItem).Where(Function(i) selectedList.Select(Function(j) j.Text).Contains(i.Text))
Dim missingItems = desiredList.Except(selectedList)
Dim selectionsCorrect = Not missingItems.Any()
Me.Text = $"Correct: selectionsCorrect; Missing items: (String.Join(", ", missingItems.Select(Function(i) i.Text)))"
End Sub
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
add a comment |
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068065%2fcompare-listviewitems-with-selecteditems%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
Dim selectedList = ListView1.SelectedItems.OfType(Of ListViewItem)
Dim desiredList = ListView1.Items.OfType(Of ListViewItem).Where(Function(i) selectedList.Select(Function(j) j.Text).Contains(i.Text))
Dim missingItems = desiredList.Except(selectedList)
Dim selectionsCorrect = Not missingItems.Any()
Me.Text = $"Correct: selectionsCorrect; Missing items: (String.Join(", ", missingItems.Select(Function(i) i.Text)))"
End Sub
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
add a comment |
Try this
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
Dim selectedList = ListView1.SelectedItems.OfType(Of ListViewItem)
Dim desiredList = ListView1.Items.OfType(Of ListViewItem).Where(Function(i) selectedList.Select(Function(j) j.Text).Contains(i.Text))
Dim missingItems = desiredList.Except(selectedList)
Dim selectionsCorrect = Not missingItems.Any()
Me.Text = $"Correct: selectionsCorrect; Missing items: (String.Join(", ", missingItems.Select(Function(i) i.Text)))"
End Sub
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
add a comment |
Try this
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
Dim selectedList = ListView1.SelectedItems.OfType(Of ListViewItem)
Dim desiredList = ListView1.Items.OfType(Of ListViewItem).Where(Function(i) selectedList.Select(Function(j) j.Text).Contains(i.Text))
Dim missingItems = desiredList.Except(selectedList)
Dim selectionsCorrect = Not missingItems.Any()
Me.Text = $"Correct: selectionsCorrect; Missing items: (String.Join(", ", missingItems.Select(Function(i) i.Text)))"
End Sub
Try this
Private Sub ListView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListView1.SelectedIndexChanged
Dim selectedList = ListView1.SelectedItems.OfType(Of ListViewItem)
Dim desiredList = ListView1.Items.OfType(Of ListViewItem).Where(Function(i) selectedList.Select(Function(j) j.Text).Contains(i.Text))
Dim missingItems = desiredList.Except(selectedList)
Dim selectionsCorrect = Not missingItems.Any()
Me.Text = $"Correct: selectionsCorrect; Missing items: (String.Join(", ", missingItems.Select(Function(i) i.Text)))"
End Sub
answered Mar 8 at 20:23
djvdjv
8,21273354
8,21273354
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
add a comment |
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
Thanks, I will try this. One Addition info, the check should not be on the Change Event, It should be a a button click
– Nils
Mar 8 at 20:31
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
You can put it where you need it. But I'd imagine it might be useful to alert the user when the form is not completed properly, before they press the button.
– djv
Mar 8 at 20:35
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
This is more then a hint "Take a look, you have not selected all Positions with the same Container, please check and correct this"
– Nils
Mar 8 at 21:21
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
Also a solution is, that if you selete Psotion1 with Container numer AAAA1234567 then automaticly alle Positions with the same Container number will be selected
– Nils
Mar 8 at 21:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068065%2fcompare-listviewitems-with-selecteditems%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can make a list out of them then check if they are equal. Should also be possible to find differences with them.
– CruleD
Mar 8 at 17:25
You mean a list from the selected ones? But how can I check if all AAAA, BBBB, etc. are selected if one of the is selected?
– Nils
Mar 8 at 17:30
Would it then not just be better to foreach through the listview and automatically select all the matching items when an item is selected?
– Charles May
Mar 8 at 18:18
Take the first selected item. Then compare it with all the others (from 1 to n-1), if it's different then you don't have the same selected items.
– the_lotus
Mar 8 at 18:30
no Auto select is not an Option, because it could also be a mistake the e.g. AAAA is selected and the User wants only CCCC. If I compare that way I do not check if all AAAA are selected or not?! So if one AAAA is selected then all AAAA should be selected but you can additionaly select BBBB or CCCC or what else
– Nils
Mar 8 at 18:34