Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
425
Getting values in a templatedcolum in a webgrid
posted

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
                }
            
            }

Parents
No Data
Reply Children
No Data