Forms Data Controls :: Use Sorting On Calculated Column?

Dec 1, 2010

Split off from http://forums.asp.net/t/1595139.aspx:

I have an additional column called 'KPI %' in my gridview that calculates the percentage of two template fields and thus I cannot use the sortexpression on it. How can I sort the contents of the 'KPI %' column in ASC or DESC format?

View 1 Replies


Similar Messages:

Forms Data Controls :: Sorting By Calculated Templatefield In Datagrid?

Sep 28, 2010

I have tried several different approaches .SOMEONE PLEASE sow me how to sort on template field with a calculated value.Basically i have half the data i need in the DB and the other half comes from textbox1.textI take the text in textbox1 and pass it along with a value from the DB (Orig) to a function that returns miles.

[Code]....

Whit the above method everything displays correctly but i cannot sort on that column .I also tried using the miles() function in my select statement for my datasource but that was a nightmare and couldn't get that to work i either got "undeclared function "miles()" or when i fixed that i got "orig" not declared.Sorry code is so jumbled , entire code is below:

[Code]....

View 15 Replies

Forms Data Controls :: Calculated Field Sorting Now Working?

Oct 1, 2010

although i had to take the table that has my calculated column and make a view (so i could filter) and then bind the gridview to the view.

My question is as this.

1.) in order to get my calculated field i had to load my data into a table (as suggested)

2.)Add a column to the table and perform calculations

3.)make a dataview from the tables because i could not get the Gridview.datasource= ds.tables("loads").select("Deadhead <= " & sngRadius

4.)the largest of the 3 tables my query is based on contains about 7000 records. The way i have the logic & programming now everytime a new "truck location" is put in the textbox1 and "find loads/button1" is clicked. It calculates the deadhead miles of all 7000 records before filtering. I am filtering based on the deadhead miles.

Does anyone have any recomendation about how to speed this up a bit.

Also in order to get paging to work i had to rebind/filter the data again ... means looping through all 7000 records each time paging is called. This seems terribly ineffecient as i am already forced to use access instead of SQL.

Would i see a performance increase if i installed SQL or mySQL and create linked tables to the ones i use in access. or would access still be the bottleneck?

I don't know if the performance increase would be negligible as i still ultimately be getting the data from Access.

I have posted the entire code for the page below. When i originally started i didn't think there would be to much code so i left it all on one page instead of using code-behind. Would i gain anything by swapping to code-behind now?

[Code]....

View 2 Replies

Forms Data Controls :: How To Sort A Gridview By A Calculated Column

May 25, 2010

Is there a way to Sort a Gridview by a Calculated Column? I have a gridview with template fields using lablels and a linq datasource. Those columns sort just fine. I can not get the Calculated column to sort, because there is no sort expression to use...

View 4 Replies

Forms Data Controls :: How To Create Calculated Column Using Boundfield In Gridview

Oct 16, 2010

how to create calculated column using boundfield in gridview?

i want to create a new column using the existing records?

View 4 Replies

Forms Data Controls :: How To Create Calculated Column With Gridview Boundfield

Oct 17, 2010

how to create calculated column with gridview boundfield?

View 2 Replies

Forms Data Controls :: Combine Two Boundfields Into One Calculated Column To Display In Gridview?

Nov 10, 2010

i am trying to combine two boundfields into one calculated column to display in Gridview like:

[code]....

View 8 Replies

Forms Data Controls :: Paging On A Different Column Than The Sorting Column

Sep 26, 2010

Situation: SQL database, Linq to SQL class a ASP.NET page with a LinqDataSource and a gridview. The table has a ID field, a date field and a Serialnr field. In my Grid I like to Page on the datefield but to sort on the serialnr field ( or a selectable other field). Is that possible? Standard the paging is always done on the sort field and when you select a different sort field the page jumps back to the first page., and paging is then done over that sorted column.

View 2 Replies

Forms Data Controls :: Sorting A Column By Simply Clicking On The Column Rather Than Clicking On The Column Header?

Jan 14, 2010

I am looking to sort a column on my gridview by simply clicking on the column rather than clicking on the column header. In the design I have been given, the column header will not be shown, and I need to be able to give the user to sort this column, by simply just clicking any where on the column.

View 2 Replies

Forms Data Controls :: Sorting Gridview Column Templatefield?

Jun 16, 2010

i want to sort a gridview column which is a template field with a repeater control in it. this column has multiple links and i would like to sort using the first link. how can i achieve this.

here is my code:

<asp:TemplateField HeaderText="Groups">

View 2 Replies

Forms Data Controls :: Sorting Date Column In Gridview?

Mar 19, 2010

In gridview columns im displaying date and time, as below.

23/02/2010 11:19:52

Im also doing sorting on these columns.

But the issue is during sorting its only sorting on "day (dd)"....

for example....these 3 values are from column, Date.

23/02/2010 11:19:52

18/02/2010 10:25:10

17/03/2010 09:30:51

when I click for "Ascending" sort....it should get "17/03/2010 09:30:51" on the top (because of month 03) others have 02, but it doesnt, it gets in the above order, its just sort on day (dd).Below is my code for boundfield....

<asp:BoundField
DataField="Date"
HeaderText="Date" [code]...

View 6 Replies

Forms Data Controls :: Sorting Using The Column Header Of A Gridview?

Jul 7, 2010

Dear all; I have the following gridview

Type Cost

BENZ 40,000

TOYOTA 20,000

Now, I would like a situation if either TYPE or Cost is clicked on, it would sort things in ascending order. see example below.

if Cost is clicked on, we will have the following sorting order.

Type Cost

TOYOTA 20,000

BENZ 40,000

I am still new to visual studio.net.

View 13 Replies

Forms Data Controls :: GridView Sorting Text On Column

Feb 21, 2011

I am trying to change the text in the header column when the GridView is sorted by checking the SortedDirection of the GridView.

problem: The text in the header column gets changed after i have clicked three times to sort the GridView.

i don't understand my problem. it seems really simple to get it work...this is what i done on each databound

[Code]....

View 15 Replies

Forms Data Controls :: Grid Sorting When Column Is Determined During RowDataBound?

Mar 3, 2011

I have a Gridview with a templated column which contains just a label.

I set the Label1.text during GridView1.RowDataBound based on doing a DataBinder.Eval(e.Row.DataItem,"myColumn") and a calculation off that.

When the user clicks the header I want it to sort based on what's in the Label but instead if seems to be sorting on the contents it was bound to, "myColumn", even though that's not what appears in the grid.

View 2 Replies

Forms Data Controls :: Sorting Not Available In A Dynamically Binded Column Of A GridView?

Jun 21, 2010

I have a auto column generated GridView in a page, I have a dynamically binded column in that gridview, when page loads then sorting option is available on all other columns except that dynamically created column.

[Code]....

View 1 Replies

Forms Data Controls :: Multiple Column Sorting In Binding List?

Aug 17, 2010

In my application binding list is used to to bind the Data to Grid view. Now the requirement is to sort on 3 columns when I bind the data to the Grid View . How can I do this?

View 4 Replies

Forms Data Controls :: Remove Sorting For Particular Autogenerated Column In Grid?

May 10, 2010

I have autogenerated columns some columns come from db and some are virtual columns what i am adding to a dataset that consist of columns from db.i want to disable sorting for the virtual columns which i add to dataset

View 2 Replies

Forms Data Controls :: Gridview Sorting Unbound Column In Bound Grid

May 14, 2010

I have a gridview control bound to a sqldatasource in c#. In the rowdatabound event I look at a value in a cell and use a function to evaluate the value and depending on that value I populate an added unbound column in my bound datagrid to show an excalmation point. I now want to sort by the column with the excalmation point.

View 2 Replies

Forms Data Controls :: GridView Editing Not Working Properly After Sorting On Any Column

Jun 2, 2010

whn i click edit button on grid before sorting on any column it is working properly...but once i click on any column for sorting n thn click on edit then the rows get sorted again and edit is set on some other row... plz help me...herez my code..

protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
gv_photo.EditIndex = e.NewEditIndex;
bindgrid("album_id");
public void bindgrid(string sort)
string str = "select * from tbl_Album";
[code]...

View 2 Replies

Forms Data Controls :: Datagrid Column Sorting With Two Columns ( File Name, And Date Created )?

Jan 3, 2011

I have a datagrid with two columns ( File Name, and Date Created ). I want them to be sorted when clicked (ASC or DESC). I went into the design view and added the allow sorting feature and added the column names, so they are clickable in the header of the data grid. I also already added the onsortcommand as well.

My datagrid is named dgFileList and the onsortcommand method is named dgFileList_SortCommand.

The procedure that is already loading on page load is a DataSet. (where I think my problem is)I dont have anything in the back end beside the dgFileList_Sortcommand method. From what I have read, it seems like I can't use a DataSet to be sorted...I'm using visual studios 2005, C#, not VB.

View 5 Replies

Data Controls :: Implement Column Sorting In GridView

Apr 19, 2013

I have a gridview with 10 columns , i want sort the gridview column and im using bound field and template field

How can i make a sorting in grid in ASP.Net using VB.Net?

View 1 Replies

Forms Data Controls :: Getting The Custom Sorting And Paging With Images To Indicate The Sorting Direction In Gridview

Jul 18, 2010

Moderators Note: THIS ISSUE IS BIG FOR ME AND EVEN IF POSSIBLE, GET THE REPLY FROM THE DESIGNER OF GRIDVIEW. I have been looking for him for long. I am really fed up with reviewing a good lot of web pages on how we can possibly customize the gridview to enable sorting and paging. So many sites have listed out a lot of information and so many guidances. But the problem is that one works out fine and the other is a burden. I really feel bad about being given the job of customizing this kind of a gridview which has no user friendly approach to it. Also, this control is rendered without the pager links inside the <tfoot> tag. I have tried the Pear Pager in php. It is that good and easy to use and compared to that, the gridview in asp.net is the worst ever control i have ever tried so far.

1. i can use the images to indicate the sorting direction
2. I can have the custom pager like

[code]

<<Previous 1 2 3 .. 7 Next >>.

[/code]

When i click the next when i am viewing the page at 3 , the pager links should change as

[code]

<<Previous 2 3 4 .. 7 Next >>

[/code]

Kindly look into this type of requirement and firstly tell me whether this is possible with the gridview control. I would like this request even to be escalated to the designers of the gridview control also, so that Microsoft comes out with a reply THAT WORKS and not the kind of stuff like surfing through a lot of links and pages and finally wasting a lot of days precious time and still breaking the head with this useless control. I have spent a lot of time in searching for a perfect way. Not writing a code that is non-standard. I am really serious b'cos I have spent weeks in customizing this control. If I dont get a solid reply atleast now, I am going to generate all the output by HTML content by custom coding.

View 7 Replies

WebMatrix :: Calculated Field (column) In WebGrid

Dec 15, 2010

Is there a way to have a calculated column (field) in a webGrid in webMatrix?

View 4 Replies

Forms Data Controls :: How To Get Fields Calculated Before They Get Displayed

Jul 27, 2010

I'm a college intern at a small software company. I'm a novice when it comes to ASP.net and Expression Web, so sorry if these are obvious questions.

1. After figuring out how to get fields calculated before they get displayed (did this with SQL), I need to find a way to put certain characters before the output in the fields. I'm fairly certain this is done with a template field, but I have no idea how to touch those without making them blow up.

2. I would also like to have color in the GridViews rows or cells depending on a value returned from the database. Again, I think this would be done with template fields.

3. Thirdly, I need to be able to limit the characters in a few cells. I've searched and found some answers with this, but still Template fields go right over my head.

View 7 Replies

Forms Data Controls :: Display Calculated Value In Gridview?

Jul 7, 2010

I have 2 amount columns (Amount and TotAmount) in my gridview. In Amount column data comes from database. I want to display the total of amounts in Amount column in my TotAmount column (So there would be just one value in TotAmount column irrespective of the number of columns in Amount column). How can I do this.

View 18 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved