Solved

Javascript - Enable GridView

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

Thanks,
Mark
0
Comment
Question by:smithmrk
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:sevensnake77
Comment Utility
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

0
 
LVL 9

Accepted Solution

by:
sevensnake77 earned 500 total points
Comment Utility
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.
0
 

Author Comment

by:smithmrk
Comment Utility
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)
    {
        contact_list.disabled=false;
    }

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.

Thanks,
Mark
0
 

Author Closing Comment

by:smithmrk
Comment Utility
OK, I figured it out!

Thanks,
Mark
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now