S Siva M Jul 22, 2005 #2 Here is one: http://www.dotnetjohn.com/articles.aspx?articleid=51 How to add CheckBox in DataGrid? any example code? thanks.
Here is one: http://www.dotnetjohn.com/articles.aspx?articleid=51 How to add CheckBox in DataGrid? any example code? thanks.
D Daniel Walzenbach Jul 22, 2005 #3 Hello, this should do: <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 9px; POSITION: absolute; TOP: 15px" runat="server" AutoGenerateColumns="False" DataKeyField="Productid"> <Columns> <asp:TemplateColumn HeaderText="ProductName"> <ItemTemplate> <asp:CheckBox id=chk runat="server" Text =<%# DataBinder.Eval(Container.DataItem, "ProductName") %> checked='<%# DataBinder.Eval(Container.DataItem, "Discontinued") %>'> </asp:CheckBox> </ItemTemplate> </asp:TemplateColumn> <asp:ButtonColumn ButtonType="PushButton" CommandName="Update" Text="Update"></asp:ButtonColumn> </Columns> </asp:datagrid> Greeting------------------------------------------ Daniel Walzenbach MCP www.walzenbach.net
Hello, this should do: <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 9px; POSITION: absolute; TOP: 15px" runat="server" AutoGenerateColumns="False" DataKeyField="Productid"> <Columns> <asp:TemplateColumn HeaderText="ProductName"> <ItemTemplate> <asp:CheckBox id=chk runat="server" Text =<%# DataBinder.Eval(Container.DataItem, "ProductName") %> checked='<%# DataBinder.Eval(Container.DataItem, "Discontinued") %>'> </asp:CheckBox> </ItemTemplate> </asp:TemplateColumn> <asp:ButtonColumn ButtonType="PushButton" CommandName="Update" Text="Update"></asp:ButtonColumn> </Columns> </asp:datagrid> Greeting------------------------------------------ Daniel Walzenbach MCP www.walzenbach.net