473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 2293
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
4
by: samb | last post by:
When I use manual databinding to a GridView control, as bellow. 'Retrive a DataSet from database Dim ds As DataSet = uda.GetUsers(conectionString) 'gvUsers - The GridView gvUsers.DataSource...
4
by: kurt sune | last post by:
I have a an aspx page with a gridview. The gridview is data bound to a generic list of custom classes. The gridview's DataSource is thus not set. Now I want to add sorting to it. So I create...
0
by: jobo | last post by:
Hey there, I'm having a problem getting sorting to work. Here's what the GridView looks like: "server" ID="updt1" Mode="Conditional">
4
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have a vb.net 2.0 app that is loading a GridView with a DataSource that is returned from a function. The definitions in the function are: Dim ReportDS As DataSet = New DataSet Dim...
1
by: l3d007 | last post by:
I used this example straight from msdn in a gridview that already sorts based on each column. For some reason I cannot get it to sort based on two sorting expressions.Is there some property of the...
1
by: mmorrison93 | last post by:
I've created my own custom gridview that derives from the System.Web.UI.WebControls.GridView class and am trying to implement my own sorting and paging mechanisms. The GridView class has two...
1
by: neobonzi | last post by:
Hello! I'm dynamically creating a GridView bound to a datatable using custom template columns using the following method: protected void ShowGrid(DataTable dt) { ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...

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.