As I spin thru the grid, row by row, I'm trying to tell if one of the radio buttons is checked. I'm not picking up any values. How do you get ANY values from a templated column? Thanks
Here is the templated column from the grid in ascx (this is column index 4):
<igtbl:TemplatedColumn AllowUpdate="Yes" IsBound="True" Width="125px"> <CellTemplate> <asp:RadioButtonList ID="CheckBox1" runat="server" EnableViewState=true RepeatDirection=Horizontal OnDataBound="GetPointsType" AutoPostBack="false" OnSelectedIndexChanged="Status_Changed" > </asp:RadioButtonList> </CellTemplate> <Header Caption="Yes/No/NA"> <RowLayoutColumnInfo OriginX="4" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="4" /> </Footer> </igtbl:TemplatedColumn>
Here is what I got in c#
RadioButton B; for (int loop = 0; loop < grid.Rows.Count; loop++) { TemplatedColumn col = (TemplatedColumn)grid.Columns[4]; CellItem item = (CellItem)col.CellItems[loop]; B = item.FindControl("CheckBox1") as RadioButton; if (B == null) {
//display error if null } }
btw, the radiobuttons (templated column) is built at runtime, so that's why you don't see any values in the ascx