How to change a BoundField's control in asp.net -
can change boundfield's control?
<asp:boundfield datafield="week1" headertext="week1" sortexpression="begindate" />
you can't change control that's created when use boundfield - that's chosen automatically based on data type of field you're binding (a checkbox gets created boolean fields, label text-type fields).
you need use templatefield if want bind data different type of control:
<asp:templatefield headertext="week1"> <itemtemplate> <asp:label id="weekonelbl" text= '<%# eval("week1") %>' runat="server"/> </itemtemplate> </asp:templatefield>
by default, boundfield use label control (like above). templatefield, change to, say, read-only textbox:
<asp:templatefield headertext="week1"> <itemtemplate> <asp:textbox id="weekonelbl" text= '<%# eval("week1") %>' runat="server" readonly="true" /> </itemtemplate> </asp:templatefield>