@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet


Comments:

<0> I have a question and don't know if there is a standard solution for it yet and just wondeing if anyone has run into it
<1> well you could always ask :)
<0> you have three list boxes selecting a single item from box one shows you the options in box 2 that are selected and box 3 shows whats available
<1> yeah ok
<1> where does the items "come" from? database?
<0> multiple selections in box1 shows the options in box2 that are common to both in a style the options that are not common in another style and the options that have been modified in another style
<0> make sense?
<1> oh ok
<0> I know how I can do it by just running comparisons against the lists but I don't know if I'm missing an obvious simplification like some type of array comparison
<1> hmm



<1> how do you determine if two items are "common" ?
<0> if they are options in both items selected in box1
<0> or I should say all items selected in box1
<0> I can't seem to figure out a way to get around comparing each list with the main list twice
<1> ok, so if an item is selected in box1, you want to color it say blue in box 2?
<1> it the same item exists in box 2 that is :)
<1> I think I'd add all the items of box1 into a hashtable, then loop over box2 and check against the hash table
<0> well the items in box 2 and 3 are from the same list but box3 are items that are not in box2
<0> box2s items are items ***ociated with the items in box1
<0> yea I think it doesn't matter how I look at it I have to make multiple comparisons though and it seems like a waste but it may be the only way to accomplish this
<0> so number of box1's selections times the number of the maximum number of items in box2 times 2
<1> well if they are directly ***ociated
<1> you could just change a flag or something
<0> that could be a big number quick
<0> hehehe
<1> well you just need to loop over box2 once
<1> not for each selected item in box1 ?
<0> well if each item has contents for box2 but I want to stylize that content based of each selection in box1
<0> then I have to compair each selections content in box1
<1> hmm i think i didn't quite grasp your setting then afterall :)
<0> hehe
<0> ever see the boxes on like web pages where you move items from one box into another
<0> in like multi select boxes
<0> its the same concept only moving to the next level
<1> yeah thought so
<0> where you have multiple items that share the same options that can be enabled or disabled
<0> if they show in one list the are enabled
<0> if they show in the other list they are disabled
<1> ah ok, thats box2 and 3 ?
<0> yup
<0> what I envision is showing items that are common between elements in box1 regular items that aren't sleected for at least one item in box1 in gray and items that have changed state in bold
<1> so list 1 holds some "objects", and the options of a selected object is then added to box2/3 depending on its state
<0> I just have issue with my brute force way of determining those states as it seems wasteful
<0> right
<1> well, when you populate box2/3, just check if the item existed before?
<1> ie maintain a count
<1> you're using listboxes for this?
<0> yes but then there is the idea of the item not being in the list



<0> yea I may change that later but it seemed suitable for this testing
<1> which item are we talking about now? :)
<0> using the listboxes for this
<1> yeah ok
<1> so like when a selection occurs in box1, you add the options related to the newly selected item to box2/3
<0> I add the items that are enabled to box2 and remove the items enabled from box3
<1> yeah ok
<1> i suggest that the items in box2/3 are objects which keep a "usage count"
<1> store these objects in a hashtable or something, alongside the listboxes for easy access
<1> when rendering, you can then quickly determine if the object is shared or not
<1> also you could keep flags in it (ie modified?)
<1> im a bit tired so perhaps im explainig this badly
<1> explaining
<0> I think it makes sense then items that have a count of the number of items sleected have a style of enabled but no in common
<0> the items that have a count equal to the number of items sleected are normal
<0> the items with no count are disabled
<1> uhm yeah something like that
<1> like i said, tired :)
<0> once I have this state I monitor changes to the list
<0> and that give me my third state
<0> that sounds much more elegant that what I had
<0> thanks
<1> sure np :)
<2> greetings everyone. Can I create create a dynamic array similar to this: ("a", "b", "c").join?
<1> uhm
<2> alternatively, supposed I wanted to concatenate a list of strings via a given character... how could I express that simply?
<1> ah ok
<1> String.Join(".", TheStrings);
<2> ah....
<2> yeah, that will work
<2> thx!
<1> np :)
<0> kewl the listbox implementation works great not LordCrc and is no where near as slow with the count method vs comparison method
<0> hrm no not in there
<1> heh, cool!
<0> sorry irc via vnc is bad
<1> ah heh i can imagine :)
<0> it shows common elements in normal text uncommon in gray and disabled shows in list box 3
<1> funky
<0> it just incriments a counter var stored in a hash table under the key for the option
<0> then I look at the hash table if the value equals the number of slected items in box1 I know it is common amoung all the selected items
<0> if it is zero then it is disabled
<0> and if it is anything else it is not common amoung all the options
<1> yeah that sounds good
<3> Yay!
<3> Finally I have t working :)


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #csharp
or
Go to some related logs:

pumpjob
usb unable to complete format
#computers
inno.exe
#politics
bartpe ghost32
#worldcup
#unixhelp
Singer of Lady In Red
#beginner



Home  |  disclaimer  |  contact  |  submit quotes