1
votes

I have an AspxGridView on my page and I have to disable it on client-side. When I want to disable an AspxButton I use btn.SetEnabled(false). And it works fine. But when I try to do the same with a grid then nothing happens! Is it impossible to disable an AspxGridView on client-side or am I doing something wrong?

2
What exactly you want disabled? remember that the gridview it's just a table at the end, if you want to disable linkbuttons or buttons inside each row of the gridview, you must iterate with jquery for example, my question again it's What exactly you want disabled? - Roberto Alarcon
What I need is disabling the grid in general. I mean, it's checkboxes, linkbuttons, disable focusing, selecting, sorting etc. I need the same effect as when setting the Enabled property of the grid to false. - Zoltan Kochan
look at the answer above, it's something like this $(this).find('td:eq(6) a').attr("disabled", true); That means that you can have a javascript function that do the hard work something like function disableGV(){ $(this).find('td:eq(6) a').attr("disabled", true); $(this).find('td:.nice-button-sample-css-class').attr("disabled", true); } and another function to toggle and there you go. Just disable all the elements you want, in this iteration by css class or id client construction. - Roberto Alarcon

2 Answers

0
votes

Client side disabling for the ASPxGridView is not implemented, sorry. It only works for controls included in the ASPxEditors Library. I would suggest that you send a callback to the server using the GridView's client side PerformCallback method and disable the grid in the GridView's server side CustomCallback event handler.

0
votes

Can you wrap the gridview in an asp:Panel and disable the panel instead?