Results 1 to 3 of 3

Thread: [RESOLVED] Getting Data from a Row on a GridView

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2012
    Posts
    29

    Resolved [RESOLVED] Getting Data from a Row on a GridView

    Hi,

    I'm starting to pull my hair out trying to figure this out and everything I've tried doesn't seem to work.

    I'm creating a website in Visual Studio 2005 with VB.NET which contains a GridView. The GridView is being populated by an SqlDataSource and has Edit and Delete buttons automatically generated.

    I have converted some of the columns to ItemTemplates and replaced the TextBox in the EditItemTemplate with a DropDownList.When I click Edit, it changes to say Update and I am trying to perform some validation at this point.

    The validation I want to perform is to check all the other rows in the GridView to make sure that the selection chosen in the DropDownList hasn't been selected on another row.

    For example,

    Row 1 DropDownList = Sick
    Row 2 DropDownList = Holiday

    Click Edit on Row 2 and change the DropDownList to be Sick and then click Update. I want a message to appear saying "Sick has already been selected" and then cancelling the Update before it happens but leaving the row in Edit mode.

    I've searched everywhere and can't seem to find a way to find how to get the value of the DropDownList in Row 1 when I'm editing Row 2.

    Can anyone help me please? :-(

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Getting Data from a Row on a GridView

    I cannot test it here but have a look:
    http://www.vbforums.com/showthread.p...light=gridview
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2012
    Posts
    29

    Re: Getting Data from a Row on a GridView

    Thanks sapator

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width