471,075 Members | 772 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

GridView sorting and persisting values

Hi all,

I currently have a Gridview that doess sorting correctly
using several fields. However, I do have a checkbox field
that when it is checked I do not know how to make its
value to persist when the page is sorted after it is changed.
I do handle the checkedchanged event, but I do not know
if it is there that I need to do something with the whole gridview or just
the checkbox that was checked/unchecked.

Thanks in advance,

Carlos.
May 16 '06 #1
3 2190
On Tue, 16 May 2006 10:43:11 -0400, "Carlos" <ch******@yahoo.com>
wrote:
Hi all,

I currently have a Gridview that doess sorting correctly
using several fields. However, I do have a checkbox field
that when it is checked I do not know how to make its
value to persist when the page is sorted after it is changed.
I do handle the checkedchanged event, but I do not know
if it is there that I need to do something with the whole gridview or just
the checkbox that was checked/unchecked.

Thanks in advance,

Carlos.


Is your checked column bound to a data column? Or, Did you add that
column dynamically?

Peter Kellner
http://peterkellner.net
May 16 '06 #2
Hi Peter,

thanks for your reply. Yes, the column is bound to a bit field, and I am
able to
place its mark on the page (i.e. does not disappear), the problem is that
when
I sort any of the columns, I miss its value because the viewstate is saved
during the not postback inside the page load event..

Thanks again,

Carlos

"PeterKellner" <pk**********@73rdstreet.com> wrote in message
news:2s********************************@4ax.com...
On Tue, 16 May 2006 10:43:11 -0400, "Carlos" <ch******@yahoo.com>
wrote:
Hi all,

I currently have a Gridview that doess sorting correctly
using several fields. However, I do have a checkbox field
that when it is checked I do not know how to make its
value to persist when the page is sorted after it is changed.
I do handle the checkedchanged event, but I do not know
if it is there that I need to do something with the whole gridview or just
the checkbox that was checked/unchecked.

Thanks in advance,

Carlos.


Is your checked column bound to a data column? Or, Did you add that
column dynamically?

Peter Kellner
http://peterkellner.net

May 16 '06 #3
On Tue, 16 May 2006 12:51:04 -0400, "Carlos" <ch******@yahoo.com>
wrote:
Hi Peter,

thanks for your reply. Yes, the column is bound to a bit field, and I am
able to
place its mark on the page (i.e. does not disappear), the problem is that
when
I sort any of the columns, I miss its value because the viewstate is saved
during the not postback inside the page load event..

Thanks again,

Carlos

"PeterKellner" <pk**********@73rdstreet.com> wrote in message
news:2s********************************@4ax.com.. .
On Tue, 16 May 2006 10:43:11 -0400, "Carlos" <ch******@yahoo.com>
wrote:
Hi all,

I currently have a Gridview that doess sorting correctly
using several fields. However, I do have a checkbox field
that when it is checked I do not know how to make its
value to persist when the page is sorted after it is changed.
I do handle the checkedchanged event, but I do not know
if it is there that I need to do something with the whole gridview or just
the checkbox that was checked/unchecked.

Thanks in advance,

Carlos.


Is your checked column bound to a data column? Or, Did you add that
column dynamically?

Peter Kellner
http://peterkellner.net


Carlos,

I've spent some time now trying to understand the behavior I'm seeing.
I assume you are using the SqlDataSource control. When I use that,
and bind it to a bit column (sqlserver2005), it shows text in the
columns (TRUE or FALSE). Very strange. Not what I would expect.

Truthfully, I almost never use sqldatasource. I always use strongly
typed dataset's which I find much easier and more flexible. I tried
the same thing with that, and bound it to an ObjectDataSource and the
behavior was exactly as I would have expected.

The bit column shows as a radio button, and editing works correctly,
and sorting maintains correctly as you would expect. (the update
event must do a databind under the covers for us to the viewstate).

At anyrate, I'm puzzled. I'll keep poking around. Hopefully on your
second post, someone who knows more than me will chime in.

Peter Kellner
http://peterkellner.net
May 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by samb | last post: by
4 posts views Thread by kurt sune | last post: by
reply views Thread by jobo | last post: by
4 posts views Thread by =?Utf-8?B?R2VyaGFyZA==?= | last post: by
1 post views Thread by l3d007 | last post: by
1 post views Thread by mmorrison93 | last post: by

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.