Solved

Javascript - Enable GridView

Posted on 2013-11-11
4
110 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
[X]
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
4 Comments
 
LVL 9

Expert Comment

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

0
 
LVL 9

Accepted Solution

by:
sevensnake77 earned 500 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.
0
 

Author Comment

by:smithmrk
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)
    {
        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
ID: 40658973
OK, I figured it out!

Thanks,
Mark
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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