473,507 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkboxes not saving state

Hi,

I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.

I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.

I also have a cached string that holds the way the dataview is sorted.

Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">

As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.

The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.

Does anyone know why this method isnt called, and/or provide some light
to the situation.

Thanks,
Arun

Aug 30 '06 #1
6 2169
Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
check so that accidental rebind on postback wouldn't "eat up" the events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<ar*********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi,

I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.

I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.

I also have a cached string that holds the way the dataview is sorted.

Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">

As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.

The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.

Does anyone know why this method isnt called, and/or provide some light
to the situation.

Thanks,
Arun

Aug 30 '06 #2
I bind on page_load...

The datasource of teh datagrid is a datatable.
That is cached.

The 'datasource' for the checkboxes is a hashtable. When a box is
checked, i want to update the hashtable and save it to the cache.

But the event to do this doesnt fire.
Teemu Keiski wrote:
Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
check so that accidental rebind on postback wouldn't "eat up" the events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<ar*********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi,

I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.

I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.

I also have a cached string that holds the way the dataview is sorted.

Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">

As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.

The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.

Does anyone know why this method isnt called, and/or provide some light
to the situation.

Thanks,
Arun
Aug 30 '06 #3
Yup, but in the Page_Load you do it inside If Not Page.IsPostBack check so
that it wouldn't get databound on every request, that's the question? That
will prevent events from firing.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
<ar*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>I bind on page_load...

The datasource of teh datagrid is a datatable.
That is cached.

The 'datasource' for the checkboxes is a hashtable. When a box is
checked, i want to update the hashtable and save it to the cache.

But the event to do this doesnt fire.
Teemu Keiski wrote:
>Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
check so that accidental rebind on postback wouldn't "eat up" the events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<ar*********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegr oups.com...
Hi,

I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.

I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.

I also have a cached string that holds the way the dataview is sorted.

Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">

As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.

The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.

Does anyone know why this method isnt called, and/or provide some light
to the situation.

Thanks,
Arun

Aug 30 '06 #4
On !postback the datagrid is filled with data from the database.

Then teh datatable from this datagrid is saved into viewstate.

On postback, teh datatable from viewstate is binded back to the
datagrid.

Is this not how i should do it?

Teemu Keiski wrote:
Yup, but in the Page_Load you do it inside If Not Page.IsPostBack check so
that it wouldn't get databound on every request, that's the question? That
will prevent events from firing.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
<ar*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
I bind on page_load...

The datasource of teh datagrid is a datatable.
That is cached.

The 'datasource' for the checkboxes is a hashtable. When a box is
checked, i want to update the hashtable and save it to the cache.

But the event to do this doesnt fire.
Teemu Keiski wrote:
Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
check so that accidental rebind on postback wouldn't "eat up" the events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<ar*********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Hi,

I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.

I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.

I also have a cached string that holds the way the dataview is sorted.

Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">

As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.

The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.

Does anyone know why this method isnt called, and/or provide some light
to the situation.

Thanks,
Arun
Aug 31 '06 #5
Btw im not stupid - i can spell "the" !

ar*********@gmail.com wrote:
On !postback the datagrid is filled with data from the database.

Then teh datatable from this datagrid is saved into viewstate.

On postback, teh datatable from viewstate is binded back to the
datagrid.

Is this not how i should do it?

Teemu Keiski wrote:
Yup, but in the Page_Load you do it inside If Not Page.IsPostBack check so
that it wouldn't get databound on every request, that's the question? That
will prevent events from firing.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
<ar*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
>I bind on page_load...
>
The datasource of teh datagrid is a datatable.
That is cached.
>
The 'datasource' for the checkboxes is a hashtable. When a box is
checked, i want to update the hashtable and save it to the cache.
>
But the event to do this doesnt fire.
>
>
Teemu Keiski wrote:
>
>Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
>check so that accidental rebind on postback wouldn't "eat up" the events.
>>
>--
>Teemu Keiski
>ASP.NET MVP, AspInsider
>Finland, EU
>http://blogs.aspadvice.com/joteke
>>
><ar*********@gmail.comwrote in message
>news:11*********************@b28g2000cwb.googlegr oups.com...
Hi,
>
I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.
>
I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.
>
I also have a cached string that holds the way the dataview is sorted.
>
Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">
>
As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.
>
The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.
>
Does anyone know why this method isnt called, and/or provide some light
to the situation.
>
Thanks,
Arun
>
>
Aug 31 '06 #6
The question is whether you do the bind on every page_load.

ar*********@gmail.com wrote:
On !postback the datagrid is filled with data from the database.

Then teh datatable from this datagrid is saved into viewstate.

On postback, teh datatable from viewstate is binded back to the
datagrid.

Is this not how i should do it?

Teemu Keiski wrote:
>Yup, but in the Page_Load you do it inside If Not Page.IsPostBack check so
that it wouldn't get databound on every request, that's the question? That
will prevent events from firing.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
<ar*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googleg roups.com...
>>I bind on page_load...

The datasource of teh datagrid is a datatable.
That is cached.

The 'datasource' for the checkboxes is a hashtable. When a box is
checked, i want to update the hashtable and save it to the cache.

But the event to do this doesnt fire.
Teemu Keiski wrote:

Do you bind the dataGrid inside Not Page.IsPostBack or !Page.IsPostBack
check so that accidental rebind on postback wouldn't "eat up" the events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<ar*********@gmail.comwrote in message
news:11*********************@b28g2000cwb.google groups.com...
Hi,
>
I have a datagrid whose datasource is a datatable which is saved to
viewstate on page_load.
>
I also have a cached string which handles what is shown on the
rowfilter of the dataview of this datatable.
>
I also have a cached string that holds the way the dataview is sorted.
>
Now, on my original datagrid i have a row of checkboxes added from the
property builder. The HTML behind it is : <asp:CheckBox id="chkPrice"
runat="server" AutoPostBack="true"
OnCheckedChanged="chkPrice_CheckChanged" EnableViewState="True">
>
As you can see when clicked, the method 'chkPrice_CheckChanged' is
meant to be called. However i dont think it is being called. I know i
it doesnt hit my breakpoint when i put one in.
>
The chkPrice_CheckChanged is meant to save all the checkbox values to a
hashtable so on the next page_load, the checkboxes can be filled again.
>
Does anyone know why this method isnt called, and/or provide some light
to the situation.
>
Thanks,
Arun
>
Aug 31 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2810
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the...
2
2422
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
6
2836
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++)...
3
3260
by: Jimmy | last post by:
Hi I have build a datalist with checkboxes in it and after a postback the state of the checkboxes have not been saved. I have enabled the viewstate of all the controls on this page. What do I...
0
316
by: arun.hallan | last post by:
Hi, I have a datagrid whose datasource is a datatable which is saved to viewstate on page_load. I also have a cached string which handles what is shown on the rowfilter of the dataview of...
10
5180
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
12
4029
by: swebster | last post by:
I need to zero in on a specific section of my jsp form during a hide to uncheck the checkboxes in that section. Currently, anything I try either unchecks all checkboxes on the form or doesn't work...
1
3757
by: colin | last post by:
Hi, I have a simple treeview, I want to put tri state checkboxes. I thought this would be standard, TreeViewNode has checkboxes, and checkboxes have tri state, but the TreeViewNode checkbox...
2
1142
by: AGP | last post by:
VB.NET 2005 i was reading some of the documentation on saving settings and i think i have a good grasp on things with the My.Settings classes. I understand how to bind a control to a setting and...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.