Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Calculate a total for values in a dropdownlist in a gridview

Posted on 2011-10-25
Medium Priority
291 Views

Row Number        District Locations

1                                       HE

2                                     RLE

3                                       :RE

4                                        JE

5                                       SE

In a gridview the alpha values come from a dropdownlist.

With a combimination of Row 1 and 2,  2 and 3, and 3 and 4, and 4 and 5.  A SQL select will be done to find a numeric value for the combos and add them together for a total.  This code must have more than one row to make the Database call for the numeric value..  Please provide the code to do this task.
0
Question by:kwcowboy1226

LVL 45

Accepted Solution

AndyAinscow earned 2000 total points
ID: 37030424
I don't really understand the question - how can you add HE and RLE - does it give HERLE ?  AND that is definately not numeric
How do you determine that row 2 belongs to TWO different selections - 1+2 and 2+3 ?
Which bit can't you do - the Experts here aren't paid to do your work for you.  Some will give code, others (like me) rather more advice.
0

Author Comment

ID: 37031566
I am very sorry guys, just wanted a starting place.
0

LVL 12

Expert Comment

ID: 37031699
Start with using the Items collection of the dropdownlist after it has been bound.  The ListItem's Value property can be sent to your database query to get the value within a loop.

Along with AndyAinscow, any further advise or snippets (examples not complete code) should be in another question.  From your comment, I assume miscomunications.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
###### Suggested Courses
Course of the Month15 days, 4 hours left to enroll