Javascript - Enable GridView

Posted on 2013-11-11
Medium Priority
Last Modified: 2015-03-11
Hello Experts!
If I disable a gridview in my code behind...how can I re-enable it using Javascript?

Question by:smithmrk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

by:Seven price
ID: 39640745
You can get the grid element with the $find(“gridId”) method and from there you have access to the get_GridView and other methods native to the grid. For example:


function BtnClick() {

            var grid = $find("WebHierarchicalDataGrid1");

            var activeRow = grid.get_gridView().get_behaviors().get_activation().get_activeCell().get_row();



Open in new window


Accepted Solution

Seven price earned 2000 total points
ID: 39640749
Most likely if this does not work. you should hide the gridview on the client side then redisplay it on the client side. Most of the time on the server side it removes the grid entirely.

Author Comment

ID: 39641780
This is my code behind:
        GV_ContactList.Enabled = False

This is my javascript that does NOT work:
    var contact_list = document.getElementById('<%=GV_ContactList.ClientID %>');
    if (null!=contact_list)

Let me try to explain what I'm trying to do...I have a Tab Container with a gridview and a check box list.  If the user does a search for a contact it fills the check box list to select a contact they searched for and I disable the gridview with the entire list...once they select one from the list of and click OK it re-enables the Gridview in the Code Behind...however if they click on another tab I want to clear the search results and enable the gridview again...everything works except the re-enable of the Gridview.


Author Closing Comment

ID: 40658973
OK, I figured it out!


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question