473,387 Members | 1,440 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, ObjectDataSource and SortDirection

Hi
Theres a SortParameterName property that can be set to pass a sort
expression, what about
a sort direction? I need this info to do my select.
I tried hacking this by wiring into GridView.RowCreated and setting
the sortexpression for
the column with the sort direction but that triggers a FieldUpdate and
goes into a recursive loop.

How do I do this? The class thats set as the TypeName in the
ObjectDataSource could be tweaked
to find the GridView somehow but that seems messy?

Ta

May 2 '06 #1
1 1749
When ascending is requested the GridView will pass the SortExpression. When
descending is requested it will append " DESC" to the SortExpression value.

-Brock
http://staff.develop.com/ballen

Hi
Theres a SortParameterName property that can be set to pass a sort
expression, what about
a sort direction? I need this info to do my select.
I tried hacking this by wiring into GridView.RowCreated and setting
the sortexpression for
the column with the sort direction but that triggers a FieldUpdate and
goes into a recursive loop.

How do I do this? The class thats set as the TypeName in the
ObjectDataSource could be tweaked
to find the GridView somehow but that seems messy?
Ta

May 3 '06 #2

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

Similar topics

0
by: Sean Sims | last post by:
recently added a LoginView to an existing page, it now looks like this: <%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="AtPress.aspx.cs" Inherits="AtPress"...
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">
0
by: sck10 | last post by:
Hello, I have a GridView that I built to show the files in a directory. The problem that I am having is that when I click on the second page (2), the GridView disappears. Also, I can't sort by...
2
by: sck10 | last post by:
Hello, I have a GridView that I built to show the files in a directory. The problem that I am having is that when I click on the second page (2), the GridView disappears. Also, I can't sort by...
5
by: Cindy Lee | last post by:
I'm getting my data from an XML file. The data binds fine, but I can't sort on it. Do I have to do anything special? I have enabled sorting on my grid view. Autogenerate columns is off, and I...
3
by: =?Utf-8?B?YmJkb2J1ZGR5?= | last post by:
I have a question that maybe somebody can help me out. I have a gridview that is bound to a sqltable, and I have created two template columns. I am having problems getting the sorting to work....
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...
0
by: rajendrsedhain | last post by:
I have problem on Gridview column sorting.I want to sort each column when click to the column head.I implemented the 'GridView1_Sorting methond by using viewstate and in this way below. ...
3
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.