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

Viewstate value not getting at client side whiledoing rad grid Operation

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arti
Top achievements
Rank 1
Arti asked on 04 Jun 2008, 09:18 AM
Hi,

I have a rad grid in which first template column and checkbox control in that column.

I have set  AutoPostBack="false" and write one event   OnCheckedChanged="CheckChanged" at the server side.

in this event I am calculating the count of selected rows and stored it in VewSte("RowCount") variable.
When I select any record by checking that checkbox and change pageindex, then first fire "CheckChanged" event (no of times as many rows selected. e.g. 2 rows selected then 2 times goes to this event) and then pageindexchanged event fire. So I have getting correct result of view state. in these events at serveside.

There is a one button below the RadGrid which is enable disable based on no of rows selected. If no rows selected then that button is disble otherwise enable. So I need viewstate value for decide where button is enable or disable.

I have write client click event of checkbox like OnClick=fnClientClick(),
i which i am getting this viewstate varianble value by using
var count = ''<%=ViewState("RowCount")%>;

but always I get blank. I cannot get true value.

I have also try by replacing viewstate to hiden variable.
but I can not get value...

Can u give me suggetion how can I get the viewstate value at client side?

Thanks
Arti Khachariya






1 Answer, 1 is accepted

Sort by
0
Prangadj
Top achievements
Rank 1
answered on 06 Jun 2008, 12:51 PM
Can you pass this value from client to server and backwards in a simple scenario (when clicking checkbox on the page for example)? If you can do that do enable/disable the button, then transfer the code when grid is involved and everything should be fine.

Prangadj
Tags
Grid
Asked by
Arti
Top achievements
Rank 1
Answers by
Prangadj
Top achievements
Rank 1
Share this question
or