+ Reply to Thread
Results 1 to 2 of 2

Thread: Passing combo box values to datagrid view

  Share/Bookmark
  1. #1

    Reputation
    Shrimpersfan's Avatar
    Join Date
    Feb 2008
    Location
    Peterborough
    Posts
    52
    Thank Post
    9
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Passing combo box values to datagrid view

    I have an application which allows the user to select multiple combo boxes and then display data in a datagrid view depending on what is selected in the combo boxes.

    However, one of my fields is called 'Fee'. Obviously, this is a decimal value, I am trying to use a combo box to select a range of fees (0 - 150, 151 - 200 etc).

    For the other 3 combo boxes on the form, the values are coming from a stored procedure, however, i cannot do this for the 'fee' field because i receive errors when it tries to convert to decimal.

    The text in my combo box will be like the example above (0 - 150) but the values in the database are formatted differently (150.00, 170.20).

    My question is, how would i be able to filter out results in my datagrid view by using a range on the 'fee' field, i thought about a case statement but at the moment it just brings back a datagrid with 'rowerrors' as a column title.

  2. #2

    Reputation Reputation Reputation Reputation
    CESIL's Avatar
    Join Date
    Nov 2006
    Location
    Hampshire
    Posts
    369
    Thank Post
    16
    Thanked 42 Times in 37 Posts
    Rep Power
    20

    Default

    How are you filling the datagrid?

    If it uses a query then that should use the BETWEEN command using the lower and upper values from the combo box. Your case statement would be able to create the sql statement.

    Does that make sense...?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. moodle ldap default values if not set by AD
    By russdev in forum Virtual Learning Platforms
    Replies: 12
    Last Post: 08-06-2010, 11:46 AM
  2. filtering datagrid with combo box
    By Shrimpersfan in forum Coding
    Replies: 1
    Last Post: 05-01-2009, 04:08 PM
  3. Exchange 2007 > *SPAM* SCL values
    By Ben_Stanton in forum Windows
    Replies: 2
    Last Post: 13-11-2008, 01:58 PM
  4. C# Help - Datagrid cell formatting
    By Gatt in forum Coding
    Replies: 6
    Last Post: 22-07-2008, 08:33 PM
  5. Passing data from dreamweaver to an Access file
    By StewartKnight in forum How do you do....it?
    Replies: 2
    Last Post: 26-01-2007, 11:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts