ASP.NET CheckBoxList DataBinding Question

后端 未结 4 1933
时光取名叫无心
时光取名叫无心 2020-12-29 21:37

Is it possible to DataBind an ASP.NET CheckBoxList such that a string value in the data becomes the label of the check box and a bool value checks/unchecks the box?

4条回答
  •  灰色年华
    2020-12-29 22:01

    I would think you would have to tell the control what property to bind it to...in this case "InRole".

    I played around with it and seems like there is noway to bind to the selection of the checkbox, you have to do it yourself. I was able to bind to the text and values of the checklist which only seem to deal with the label of each checkbox in the list.

提交回复
热议问题