asp.net - C# Populating CheckBoxList from database (strange column/header text name) -
i working on small project asp.net web forms, backend language c#, , want populate checkboxlist database, , did it, values strange, need names of database columns or something, because right looks this:
on windows forms know do, (display member = "name") , problem solved, on web dont know how columns name, because looks strange..
thanks guys,
cheers.
if checkboxlist
not instructed otherwise, calls object.tostring()
populate text
property of listitems
. if tostring()
not overridden, default implementation this.gettype().tostring()
seeing. gettype()
returns such bizarre value because entity framework dynamically subclassing class @ run-time.
my preferred way of doing override tostring()
return name
property, good practice in general override tostring()
classes.
another option assign datatextfield
property of checkboxlist
"name".
Comments
Post a Comment