Results 1 to 3 of 3

Thread: ASP.net Gridview issues

  1. #1
    Hmmm bed
    Join Date
    Jul 2003
    Posts
    441
    Thanks
    5
    Thanked
    0 times in 0 posts

    ASP.net Gridview issues

    Hi, I havea gridview displaying some employee info from a DAL which connects to a DB.

    I have several fields including name, branchid and roleid

    Now, I am trying to use the update functions within the gridview, and this works to raw edit teh id's so I can change the branch id etc.

    I have added a template field to allow me to add a drop down box as the branch selection tool, what I want this to do is when users click the edit button a drop down list is populated with the options for the branches.

    I have this in place, but it doesn't appear to work! it just won't update the branch field!

    Does anyone have any ideas on if indeed this can be done?

    Regards,

    James

  2. #2
    Senior Member Shad's Avatar
    Join Date
    Jul 2003
    Location
    In front
    Posts
    2,773
    Thanks
    22
    Thanked
    40 times in 24 posts
    Presumably there is some kind of 'RowEdit' event that fires when you click Edit? I'd have thought all you need to do is look in the Controls property (assuming it's present) for the sender object in the handler and populate the drop down at that point?

    I'd have to look it up to give you a more accurate answer I'm affraid!

    HTH
    Simon


  3. #3
    Theoretical Element Spud1's Avatar
    Join Date
    Jul 2003
    Location
    North West
    Posts
    7,494
    Thanks
    335
    Thanked
    313 times in 249 posts
    • Spud1's system
      • Motherboard:
      • Gigabyte Aorus Master
      • CPU:
      • 9900k
      • Memory:
      • 16GB GSkill Trident Z
      • Storage:
      • Lots.
      • Graphics card(s):
      • RTX3090
      • PSU:
      • 750w
      • Case:
      • BeQuiet Dark Base Pro rev.2
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Asus PG35VQ
      • Internet:
      • 910/100mb Fibre
    ^^ shad has it - there are multiple events for that, RowEditing, RowUpdated, RowUpdating.

    You should be able to use RowEditing to populate the DDL.

    Populating itself it a bit more complex, you have to mess about with findControl[""] and cast it to a DDL to populate it; I had a few problems with this when I tried but in theory it should work

    Also take a look at www.gridviewguy.com, best resource for gridview stuff that i know of.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Get 3 issues of Men's Fitness for just £1
    By 0iD in forum Retail Therapy and Bargains
    Replies: 1
    Last Post: 03-11-2006, 06:00 PM
  2. Shuttle ST61G4 - Stability Issues.
    By DJWillis in forum PC Hardware and Components
    Replies: 4
    Last Post: 23-01-2005, 07:56 PM
  3. Wanted - Custom PC back issues
    By sirelmo in forum Retail Therapy and Bargains
    Replies: 2
    Last Post: 28-07-2004, 08:30 PM
  4. CAT 4.6's
    By Steve in forum Graphics Cards
    Replies: 18
    Last Post: 13-06-2004, 11:36 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
  •