or
| <telerik:RadGrid ID="RadGridAccounts" DataSourceID="SqlDataSourceAccounts" runat="server" |
| OnItemDataBound="RadGridAccounts_OnItemDataBound" AllowPaging="True" PageSize="10" ShowHeader="false"> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <MasterTableView><ItemTemplate> |
| <h4>Account # <%# DataBinder.Eval(Container.DataItem, "AccountNumber") %> </h4> |
| <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> |
| <br /> |
| <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> |
| <br /> |
| <asp:PlaceHolder ID="PlaceHolder3" runat="server"></asp:PlaceHolder> |
| </ItemTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
For each account I show different account details in three radgrids that I create dynamically.
| RadGrid1 = new RadGrid(); |
| RadGrid1.Skin = "Office2007"; |
| RadGrid1.Width = Unit.Percentage(100); |
| RadGrid1.AutoGenerateColumns = false; |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = "Asset"; |
| boundColumn.HeaderText = "Asset"; |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = "Value"; |
| boundColumn.HeaderText = "Value"; |
| boundColumn.DataFormatString = "{0:C}"; |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| RadGrid1.DataSource = dt; |
| RadGrid1.DataBind(); |
| PlaceHolder1.Controls.Add(RadGrid1); |
What I need to do is dynamically add a checkbox to each row in the radgrid. When I try this:
| GridCheckBoxColumn checkboxColumn = new GridCheckBoxColumn(); |
| checkboxColumn.DataField = "Problem"; |
| checkboxColumn.HeaderText = "Problem?"; |
| RadGrid1.MasterTableView.Columns.Add(checkboxColumn); |
then the checkboxes are disabled. I guess I need to put the grid in edit mode? How would I do that? I don't want the users to edit any columns besides checking the checkboxes.
Another question is - after a user checks some checkboxes and clicks on "Save", how do I refer to the checkboxes inside the grids inside the accounts grid to save the changes to the database?
Thanks,
Julia

filterBox.Attributes.Add("OnChange", "javascript:return false;")