.net - Checkboxes to indicate inclusion in a list? -


i have 2 tables, called machine , type. since have many-many relationship, have machinetype resolution table in db. no problem.

the end user needs able manage these - create new types , assign them machines. have xtragridview using display machine master , type detail.

initially used lookup add type dropdowns machinetype detail view. creates duplicates , not best way display information. i'd series of checkboxes (one each type options available) user can click appropriate ones each machine, avoiding duplicates. upon saving, appropriate machinetype rows can generated.

i going code manually if there's kind of binary collection mapping in either devexpress or .net framework can use, i'd prefer reinvent wheel.

cheers

edit: this mean. this thread. however, store collection (a string delineated commas) , not series of db rows.

are interested in returning values bind linq query?

from m in machine t in type select new {m,t} 

this give cross join each of pairings on save can check see if machinetype table has pairing already

from mt in machinetype mt.machineid == <machine list> && mt.typeid == <type list> 

if want pass query lists can send list of pairings can send dictionary , loop through or use contains() function if dictionaries support that.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -