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


Similar Messages:

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

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 :: Adding A Calculated Field To A Databound Control?

Oct 19, 2010

I'm using a gridview to extract a set of records. I need to add another field to the gridview, which can calculate the difference between a date associated with each record and the current date.

View 6 Replies

DataSource Controls :: Get Calculated Field Into SQL?

Jan 14, 2011

At the top of my form I have some code that calculates a field

[Code]....

In my form I have this code. What changes below do I need to make to have the value of Date in XXXX?

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:sqlConnection %>"
SelectCommand="SELECT NumPeople, Date1,Time1,Venue FROM People_Count WHERE ((Date1=@ArvDate and Time1 >= '06:00:00.000') or (Date1=XXXX and Time1 <= '06:00:00.000')) and Venue='F & B' ORDER BY Date1 ASC, Time1 ASC">
<SelectParameters>
<asp:QueryStringParameter Name="ArvDate" QueryStringField="ArvDate" />
</SelectParameters>
</asp:SqlDataSource>

View 2 Replies

Forms Data Controls :: GridView Template Field With Linkbutton Not Sorting?

Jun 22, 2010

I have a gridview control set up like so:

[Code]....

I am using an IComparer to do the sorting of the gridview and binding it to a list of objects. It used to be that the linkbutton in the first template field was being done like this:

[Code]....

The sorting worked just fine when it was like this, but I would prefer not to use a querystring value. The problem with using the linkbutton is that the sorting appears to work (there are only two rows in my test case and they change places), but when the linkbutton is clicked on it is in the same order before the sort took place. After each sort the gridview's datasource is reset to the newly sorted list of objects and the databind method is called.

View 3 Replies

DataSource Controls :: SUM Function On A Calculated Field Does Not Work SQL 2005?

Mar 20, 2010

I have a simple query on a table to calculate the sum of a field (This field is a calculated field from within SQL 2005)SELECT SUM(RunTime) AS TotaL FROM TimeSheets.It errors out with: Error Message: Operand data char type char is invalid for sum operator.If I use the MAX or MIN function, no isssues. The data in this field is numeric.

View 4 Replies

Forms Data Controls :: ListView Sorting Not Working

Mar 29, 2010

My sorting does not work .. When I click on my sorting, I get a server error 500.

[Code]....

View 1 Replies

Forms Data Controls :: GridView Sorting Is Not Working

Mar 21, 2011

I set Allowsorting="true" but sorting is not working in my GridView.Here is code of aspx page:

[Code]...

View 7 Replies

Forms Data Controls :: Sorting Not Working In Listview?

Jan 3, 2010

I have a problem whit sorting in my Listview... its dosent sort..

[Code]....

View 11 Replies

Forms Data Controls :: Editing Is Not Working Along With GridView Sorting

May 13, 2010

I also try setting editIndex to -1 in my sort function but that also doesn't work So when I am editing then sort event fire and edit item got change, so edit functionality is not working with sorting

[Code]....

View 5 Replies

Forms Data Controls :: Sorting In Gridview Not Working Properly

Feb 3, 2010

have a gridview which i a using for sorting data in it.IT sorts the first time i click on cloumn in ascending order.When i click on column again , i want to sort it in descending order again , but it does not happen ,

protected void SearchResultsGridView_OnSorting(object sender, GridViewSortEventArgs e)
SortDirection sortDirection = GetSortDirection(e.SortExpression);
presenter.SortResultsView(sortDirection.ToString(), e.SortExpression);
[code]...

View 4 Replies

Forms Data Controls :: Gridview Checkbox Sorting Not Working

Sep 13, 2010

I have a grid view which populates data just for viewing purpose(report) . One field shows the Active/inactive status for which I am showing a checkbox..if data in database is 1 then the checkbox will be checked otherwise it'll not be checked. This field is inactive so that the User does not check/uncheck it. The issue is that this field cannot be sorted. All the fields in the gridview are being sorted.

<asp:TemplateField HeaderText="InActive" SortExpression="Inactive">
<HeaderTemplate >
<asp:Label ID="lblStat" CssClass="copyLabel" Text="Inactive" CommandArgument="Inactive"
[code]...

View 4 Replies

Forms Data Controls :: Gridview Edit Not Working After Sorting ASP.NET

Jun 4, 2010

I have a Gridview for which I have provided Sorting, Edit functionality. I am not able to perform EDIT when I perform Sorting. After sorting edit is set on some other row. I think there is some problem with the index it is taking..

[Code]...

View 7 Replies

Forms Data Controls :: Manual Sorting Not Working On Grid View?

Jul 20, 2010

I go this code that can so a manual sorting on grid view. The code works fine for "ASC", when I wanted to sort the field to DESC, it never works. Second, it also failed when I switch to another page. Case 1: By default, the column is sorted DESC, then I switch to ASC, works fine, then I switch to DESC, it failed (remain at ASC).Case 2: By default, the column is sorted DESC, then I switch to ASC, works fine, then I switch to other page, it failed (remain at DESC on new page).

[Code]....

View 6 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

ADO.NET :: Calculated Field In Select Statement?

Feb 3, 2011

I thought this would be easy but cannot now find out of to do it. All I want to do is execute an sql query on a table and in addition to the table's columns I want to also select/output a field that is calculated within the query. The table has a column "Owner" and I want to compare this to the UserId to produce a bool column "mine". Effectively doing:Select *, (Owner=@UserId) as mine where.....however, this doesn't work so how can I calculate a column in the select statement?

View 3 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 :: 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

Forms Data Controls :: Template Field Is Not Working In 4.0?

Feb 10, 2011

<Columns>

Template field is not working in 4.0?

View 1 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

Forms Data Controls :: How To Add Calculated Fields On A Gridview

Jul 21, 2010

My gridview displays fields from a table and allows for edit, delete and insert. I need to add a column with a derived field which will be calculated every time the user is either entering a new row or editing the value of the weight field which is one of the fields of the gridview. This calculation is done in the fly and won't be saved in the database.

View 8 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 :: Calculated Fields For All Of The Rows Is Blank

Jun 22, 2010

I have a GridView bound to an ObjectDataSource. Most of the columns are directly databound, however one column is not - it's value is determined in code. The value is being calculated correctly at the RowDataBound event, however when there is more than one data row in the GridView, the calculated fields for all of the rows is blank, but the top row displays the bottom row's calculated field

View 2 Replies







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