473,288 Members | 1,718 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,288 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 2288
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) { ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.