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

  • Home
  • SEARCH
  • 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 7037803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:35:21+00:00 2026-05-28T01:35:21+00:00

<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False Width=596px DataKeyNames=Key > <Columns> <asp:BoundField DataField=Key HeaderText=Key SortExpression=key Visible=False />

  • 0
<asp:GridView 
ID="GridView1" 
runat="server" 
AutoGenerateColumns="False" 
Width="596px" 
DataKeyNames="Key" >

<Columns>
<asp:BoundField DataField="Key" HeaderText="Key" SortExpression="key" Visible="False" />
<asp:BoundField DataField="StockId" HeaderText="StockId" Visible="False" />
<asp:BoundField DataField="Freq1" HeaderText="Freq1" Visible="False" />
<asp:BoundField DataField="Freq2" HeaderText="Freq2" Visible="False" />     

<asp:BoundField DataField="MedicineName" HeaderText="MedicineName" ReadOnly="true" />

<asp:TemplateField HeaderText="DoseQty"                                                         
    <ItemTemplate>
        <asp:TextBox ID="txtDoseQty" Text='<%# Bind("DoseQty") %>' runat="server"
        Height="23px" Width="38px" onchange="javascript:dataChange(event);" ></asp:TextBox>
    </ItemTemplate>
</asp:TemplateField>

<asp:BoundField DataField="DoseUOM" HeaderText="DoseUOM" ReadOnly="true" />

<asp:TemplateField HeaderText="Duration">
    <EditItemTemplate>
        <asp:TextBox ID="Duration" runat="server" Height="16px" 
            Text='<%# Bind("Duration") %>' Width="45px" onkeypress="return isNumberKey(event);">    </asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label ID="lblDuration" Text='<%# Bind("Duration") %>'  runat="server"></asp:Label>
    </ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="Delete All">
    <HeaderTemplate>
        <asp:CheckBox ID="chkHeaderDelete" runat="server" Text="Delete All" 
            onclick="javascript:SelectheaderCheckboxes(this)" />                                                            
    </HeaderTemplate>
    <ItemTemplate>
        <asp:CheckBox ID="chkItemDelete" runat="server" AutoPostBack="true"
            Text="Delete" onclick="javascript:SelectitemCheckboxes(this)"  />
    </ItemTemplate>
</asp:TemplateField>

<asp:CommandField HeaderText="Update" 
    ShowEditButton="True"                                                         
    CausesValidation="false"  />

</Columns>

I am using traditional JavaScript(not JQUERY) to read a value from Asp.net GridView at client site.
But after I trying several times, I found that I don’t know how could I read a value from BoundField Column which is “Visile=False” ,in pure javascript.

var grid = document.getElementById("<%= GridView1.ClientID %>");
var OutputString = "";
if (grid.rows.length > 0) 
{
for (i = 1; i < grid.rows.length - 1; i++) 
{
    for (j = 0; j < grid.rows[i].cells.length; j++) 
    {
        if (j == 1) 
        {
        OutputString += "grid.rows[i].cells[" + j + "]  :" + grid.rows[i].cells[j] +
        "\ngrid.rows[i].cells[" + j + "].innerText :" + grid.rows[i].cells[j].firstChild.value;
        OutputString += "\n\n";
        } 
        else 
        {
            OutputString += "grid.rows[i].cells[" + j + "]  :" + grid.rows[i].cells[j] +
            "\ngrid.rows[i].cells[" + j + "].innerText :" + grid.rows[i].cells[j].innerText;
            OutputString += "\n\n";
        }
    }   
}
}

Output

grid.rows[i].cells[0]  :[object]
grid.rows[i].cells[0].innerText :Abd pant XXXL

grid.rows[i].cells[1]  :[object]
grid.rows[i].cells[1].innerText : 12

grid.rows[i].cells[2]  :[object]
grid.rows[i].cells[2].innerText :Pieces

grid.rows[i].cells[3]  :[object]
grid.rows[i].cells[3].innerText :1 

grid.rows[i].cells[4]  :[object]
grid.rows[i].cells[4].innerText :Delete 

grid.rows[i].cells[5]  :[object]
grid.rows[i].cells[5].innerText :Edit

In Javascript, is this possible to read the value from bondfield which is visible false?


[Updated]

All the output which I get only from Textbox template field and BoundField which is not “Visible=False”.

Please let me know the way, and your suggestion will be appreciated.

  • 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-28T01:35:22+00:00Added an answer on May 28, 2026 at 1:35 am

    Controls with Visible=”false” will not be rendered and therefore generate no HTML.

    If you want to make your controls invisible but still reference them, first remove Visible=”false” and then you could either use CSS on your controls:

    style="display:none;" 
    

    Or you could hide the GridView columns (your first four BoundFields) in your RowDataBound event after they’ve been rendered:

    protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells[column_index].Visible = false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=false Height=146px Width=308px> <Columns> <asp:TemplateField HeaderText=Original Price ControlStyle-Width=100px> <ItemTemplate> <asp:TextBox ID=txtOriginalPrice
I have a Gridview <asp:GridView ID=GridView1 runat=server Width=400px AutoGenerateColumns=false OnSelectedIndexChanged=GridView1_SelectedIndexChanged1> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox
I want to populate GridView below with images: <asp:GridView ID=GrdDynamic runat=server AutoGenerateColumns=False> <Columns> </Columns>
protected void GridView1_DataBound(object sender, EventArgs e) { GridView1.Columns[0].ItemStyle.Width = 400; <asp:GridView ID=GridView1 runat=server DataSourceID=ObjectDataSource1
I Have a and ASP.NET GridView which is set so <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False
I have a gridview with the alternatingRowStyle property set. <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False DataSourceID=SqlDataSource2
I have a gridview like below: <asp:GridView DataKeyNames=TransactionID AllowSorting=True AllowPaging=TrueID=grvBrokerage runat=server AutoGenerateColumns=False CssClass=datatable Width=100%
<asp:GridView ID=GridView1 runat=server style=height: 121px; width: 175px BackColor=White BorderColor=#3366CC BorderStyle=None BorderWidth=1px CellPadding=4 onrowediting=GridView1_RowEditing AutoGenerateColumns=false>
Why ItemStyle-VerticalAlign=Middle not work in asp:GridView?, this is my code <asp:GridView ID=GridView1 runat=server RowStyle-VerticalAlign=Middle
I have a GridView defined like this: <asp:GridView ID=myGridView ruant=server> <asp:BoundField DataField=myField /> <asp:CommandField

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.