Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6994889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:57:01+00:00 2026-05-27T19:57:01+00:00

I’m unable to find the textbox control in a gridview. And the below code

  • 0

I’m unable to find the textbox control in a gridview. And the below code is always returning NULL

HTML:

<asp:TemplateField>
    <HeaderTemplate>
        <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                margin-left: 0px">
            <tr>
                <td>
                    &#160;&#160;
                </td>
            </tr>
            <tr>
                <td align="center">
                    SkillColumn1
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table cellpadding="0" cellspacing="0" style="width: 100%">
            <tr style="width: 100%">
                <td style="width: 25%">
                    <asp:TextBox  ID="txt_Skill1" runat="server" Text='<%# Eval("Skill1_value") %>'
                            CssClass="tms-secondaryRowTextBoxNew" Width="35%" />
                </td>
            </tr>
        </table>
    </ItemTemplate>

Entire Mark up:

<asp:GridView ID="gvLocView" runat="server" AutoGenerateColumns="False" CellPadding="0"
                Width="100%" BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" 
                EmptyDataText="No Data Available" 
                onrowdatabound="gvLocView_RowDataBound">
                <Columns>                      
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                <tr>
                                    <td align="center">
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        Location
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 50%">
                                        <asp:Label ID="lblLocation" runat="server" Text='<%# Eval("Location") %>' CssClass="tms-secondaryRowTextBoxNew" />
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="14%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        Quarter
                                    </td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 100%">
                                        <asp:Label ID="lblQuarter" runat="server" Text='<%# Eval("Quarter") %>' CssClass="tms-secondaryRowTextBoxNew" />
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="13%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                  <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn1
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 25%">
                                    <asp:TextBox  ID="txt_Skill1" runat="server" Text='<%# Eval("Skill1_value") %>'
                                            CssClass="tms-secondaryRowTextBoxNew" Width="35%" />                                           
                                    </td>
                                  </tr>
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>  <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn2
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">                                     
                                    <td style="width: 25%">
                                        <asp:TextBox ID="txt_Skill2" runat="server" Text='<%# Eval("Skill2_value") %>'
                                            CssClass="tms-secondaryRowTextBox" Width="35%" />
                                    </td>
                                  </tr>
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                       </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                 <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn3
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 25%">
                                        <asp:TextBox ID="txt_Skill3" runat="server" Text='<%# Eval("Skill3_value") %>'
                                            CssClass="tms-secondaryRowTextBox" Width="35%" />
                                    </td>
                                  </tr>  
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                 <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn4
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 25%">
                                        <asp:TextBox ID="txt_Skill4" runat="server" Text='<%# Eval("Skill4_value") %>'
                                            CssClass="tms-secondaryRowTextBox" Width="35%" />
                                    </td>
                                 </tr>   
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                 <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn5
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 25%">
                                        <asp:TextBox ID="txt_Skill5" runat="server" Text='<%# Eval("Skill5_value") %>'
                                            CssClass="tms-secondaryRowTextBox" Width="35%" />
                                    </td>
                                 </tr>   
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                 <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        SkillColumn6
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>                               
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                   <td style="width: 25%">
                                        <asp:TextBox ID="txt_Skill6" runat="server" Text='<%# Eval("Others") %>'
                                            CssClass="tms-secondaryRowTextBox" Width="35%" />
                                    </td>                                       
                                </tr>
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>
                            <table cellpadding="0" cellspacing="0" style="padding-left: 0px; padding-right: 0px;
                                margin-left: 0px">
                                 <tr>
                                    <td>
                                        &#160;&#160;
                                    </td>
                                </tr>
                                <tr>
                                   <td align="center">
                                        Total
                                    </td>
                                </tr>
                                </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr style="width: 100%">
                                    <td style="width: 100%">
                                        <asp:Label ID="lblTotal" runat="server" Text='<%# Eval("Total") %>' CssClass="tms-secondaryRowTextBoxNew" />
                                    </td>
                                 </tr>   
                            </table>
                        </ItemTemplate>
                        <HeaderStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" Width="9%" />
                        <ItemStyle BorderColor="#013963" BorderStyle="Solid" BorderWidth="1px" />
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle CssClass="tms-primaryRow_new" />
                <HeaderStyle Font-Bold="True" ForeColor="White" CssClass="tms-gridViewHeader_fy11"
                    HorizontalAlign="Center" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>

Codebehind:

if (e.Row.RowType == DataControlRowType.Header)
    {
        int counter=0;

        for (int j = 1,col=2; j <= 7; j++,col++)
        {
            TextBox t = (TextBox)e.Row.Cells[col].FindControl("txt_Skill" + j.ToString());

            if (t != null)
            {
                t = e.Row.FindControl("txt_Skill" + j.ToString()) as TextBox;
                if (!string.IsNullOrEmpty(strSkillArray[counter]))
                    t.Text = strSkillArray[counter].ToString();
            }                
        }
    }

Exception:

System.Web.HttpException was unhandled by user code
Message=”DataBinding: ‘System.Data.DataRowView’ does not contain a
property with the name ‘Skill1_value’.” Source=”System.Web”
ErrorCode=-2147467259 StackTrace:
at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName)
at System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts)
at System.Web.UI.DataBinder.Eval(Object container, String expression)
at System.Web.UI.TemplateControl.Eval(String expression)
at ASP.location_aspx._DataBinding_control53(Object sender, EventArgs e) in d:\ABC\Location.aspx:line 251
at System.Web.UI.Control.OnDataBinding(EventArgs e)
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBind()
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBind()
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBind()
at System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState
rowState, Boolean dataBind, Object dataItem, DataControlField[]
fields, TableRowCollection rows, PagedDataSource pagedDataSource)
at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable
dataSource, Boolean dataBinding)
at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
data)
at System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable
data)
at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
data)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.GridView.DataBind()
at Location.UpgradeAccount() in d:\ABC\Location.aspx.cs:line 368
at Location.Page_Load(Object sender, EventArgs e) in d:\ABC\Location.aspx.cs:line 70
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:57:02+00:00Added an answer on May 27, 2026 at 7:57 pm

    Your exception has nothing to do with the codebehind you posted. The page cannot bind your grid to whatever DataSource you gave it because it cannot find Skill1_value in your DataSource.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.