This is a migrated thread and some comments may be shown as answers.

Disable Grid Client-Side

2 Answers 261 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 31 Jan 2011, 07:16 PM
I would like to disable my RadGrid through JavaScript.  How can I do this?  Server-side, I would call "rgGrid.Enabled = False". 

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Feb 2011, 05:47 AM
Hello Ryan,

When you want to enable/disable your grid client-side when certain conditions are met, you will need to take into account that you should disable the active links/images/inputs/spans/etc. inside the grid manually.

Refer the following documentation for more on this.
Enabled/Disabled conventions

Thanks,
Shinu.
0
Ryan
Top achievements
Rank 1
answered on 01 Feb 2011, 02:25 PM
That's perfect.  I don't know why I couldn't find that resource before.  I used the following code:

// Disable the textboxes
var textBoxes = document.getElementsByTagName('input');
for (var textBoxNumber = 0; textBoxNumber < textBoxes.length; textBoxNumber++) {
    if (textBoxes[textBoxNumber].className != "rcbInput") textBoxes[textBoxNumber].disabled = 'true';
}
// Disable the grid
$find("<%=rgPlan.ClientID%>").get_element().disabled = "disabled";

Thanks!
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Share this question
or