Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:58:47+00:00 2026-06-07T04:58:47+00:00

So I have a method I wrote that will copy the selectedValue from one

  • 0

So I have a method I wrote that will copy the selectedValue from one dropdownbox to another in a specific row. It is called from a button on the row on the OnCommand Event.

    protected void Copy(String From, String To, GridViewRow CurrentRow)
    {
        DropDownList FromList = (DropDownList)CurrentRow.FindControl(From);
        DropDownList ToList = (DropDownList)CurrentRow.FindControl(To);
        ToList.SelectedValue = FromList.SelectedValue;
    }

Now When I use this on a footer row everything works fine, however, when I try to call this while editing a row, I can see data if I Debug, however, the dropdown will not populate. No errors, occur.

I did step Into thru the process, and it’s calling my Grids RowEditing event (Which populates all the dropdowns) again after my OnCommand Event fires. So my guess is that its just wiping out the changes I made by repopulating the dropdowns.

Is there a way to prevent the RowEditing event from refiring (even if its just so I can prove myself right or wrong)? Should I be handling this copy in some other way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:58:48+00:00Added an answer on June 7, 2026 at 4:58 am

    So I found my issue this morning, and it was because I was using the CommandName attribute on my button, or more specifically the name I was using.

    I thought the CommandName was just an empty spot for you to pass a value, but if you use a certain name, like “Edit”, it will actually kick off the RowEditing event for the grid the button is associated with.

    I didn’t think this would work this way (considering is was associated with the button, not the Grid) but as soon as I changed the command name, it worked just fine. I changed it back, and it was broken again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have and old(ish) C# method I wrote that takes a number and converts
I have this method (someone else wrote it!) - (CGPDFDocumentRef)getPdf { NSArray *paths =
I have wrote a method to convert any layout Liner,Relative,Frame etc into Bitmap but
I have method that returns Drawable , and if its Bitmap object is recycled
I have method that returned NSManagedObject and I don't know what kind of NSManagedObject
I have method that returns module path of given class name def findModulePath(path, className):
I have method in a class that I need to make sure is only
I'm trying to write an extension method that will add the function HasFactor to
Quick one; am I right in thinking that passing a string to a method
I'm working on an automation tool that will copy a series of commands to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.