Change Another Column Value based on Dropdownlist selected value while gridview onrowediting

Hi everyone.

Another gridview question again.

I have a gridview, with three columns, Code, Description and Action.

The Code column, when I click on the Edit linkbutton on the Action column becomes a dropdown list.

How can I do that when I selected a value from the dropdownlist, the value of the description on would be changed to the description corresponding to the dropdownlist?



10/12/2007 8:04:14 AM 72751 articles. 1 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 6


  From your description I think you can try:

1. Set AutoPostBack=true for your DropDownList.

2. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

//sender.Parent.Parent is the GridViewRow from which you can assign value to another control on the same row.


  If it doesn't work, please inform us.


Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
10/15/2007 4:51:36 AM

Hi Allen.

I got the answer from this post.

Thanks anyway.  I am going to click on this as resolved already.

10/17/2007 7:09:29 AM

Similar Artilces:

Change / hide gridview column value based on value in different colum in same row
Hi allI've come across a unusual problem that I can't work out.  I'm using VB by the way.  I have a gridview that is populated from a "suggestions" database and contains 6 databound columns - ID, Firstname, Surname, Department, Suggestion, HideName. The gridview pulls the details from the database and displays all the values as should be. When a user adds data to the databse they have a option to hide their identity by placing a tick in a checkbox. This all gets updated without any issues. The Firstname and Username get automatically populated from their User ...

gridview with dropdownlist to a column, need to change same row textbox value after selected index chnaged
in my web page i have gridview with dropdown list for  one column productname, price, paid amount , money taken are coulmns, when select money take yes from drop downlist, need to get value from price column and fill paid amount cell in the same row. i am strugeling to get row id and then to get price to amount paid cell. how to get this. this is code bit.     <asp:GridView ID="GridViewordersummary" runat="server" AutoGenerateColumns="False"                 ...

<%@ Page Explicit="True" Language="VB" Debug="True" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <HTML> <Script Runat="Server"> Dim aConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" _ & server.mappath("Group17.mdb") Sub Page_Load(Sender As Object, E As EventArgs) Dim aConnection As OleDbConnection Dim aQuery, bQuery As String Dim aDataReader, bDataReader As O...

DropDownList value selected base on database value?
Hi, is there anyway how I can allow my dropdownlist (on pageload event) to select the value base on the value found in the database, in addition I also want the dropdownlist to contain other values too however the selectedValue must be the one found in the database. Sorry if it sounds confusing. I'm using VB.NET 2003 with ASP.NET Thanks. Hi,Whatever you want to get selected for your dropdown use following code.if(dropdownid.items.findbyvalue("value") != null){    dropdownid.items.selecteditem = false;    dropdownid.items.findbyvalue("value").selected = t...

change format of one control based on value of another control
Hi, I am very new to and need some help with an odd requirement.  We use Visual Web Developer for all our work and have built our corporate intranet around it.  On our home page we have a hyperlink to our IT departments status page (traffic light system), we want to change the colour of the hyperlink text to be the same as the most serious traffic light on the other page (may be even flash the text for "red" issues)? Our IT department directly edit the traffic light network status page themselves, via a text editor, so the hyperlink on the home page needs to pic...

Dropdownlist selected value passes first value in list no matter what value is selected. why ?
 HI . I have a dropdownlist. Databinds ok but when I must pass a value as a Selected value it always passes the first value in the list even if I select another value. I tried to set the ddl to enableviewstate false but it doesn't change anything. Any ideas ? Code below, thanksLoading the ddl:       productCategories = CatalogAdmin.Admin_Product_Categories_NotIn(productId);        for (int i = 0; i < productCategories.Rows.Count; i++)        {       &...

About Today's (2005-01-07) Article 'Change the style of a column within a GridView control based on its value'
Hi I read the article, sounded interesting although I've done it several times in (vb), not in C# as this article is. I wonder what the author tries to prove with this article since you cannot run it and see what it does? Since there's some hints that it might be using the Northend database there's no sign of it in the code, thus you can't do anything. Has the author deliberatly left out the datasource so that noone will ever know what the code does? Or is it so that he never thoght of the datasource since that worked in his machine, and he thought if it does work on hi...

Iwant to select a row and column in gridview with select radiobutton. but No checked change event.below put a button .if click that button to seleced row values will select
I want to select a row and column in gridview using radiobutton in gridview . if which radio button is select that row will select and i want that row column values in outside individual textboxes of next page.  but in that only single radiobutton will select and no post back="true" bcz iam not using checked change property. i inserted button below gridview. if i click the that selected row and columns values are stored into textboxes of next page im using this code .but im getting one column in that row. but i want all columns in that selected row so plz repla...

Changing GridviewColumn value font based on other column value
 Hi i have the following in my gridview iam checking a column value here if it is true i want to set the value1 otherwise 0 which works fine question is if it is 1 i want to change the font values of column  "Person"  to Bold it possible to dod this  in the markup language when iam checking the incidnet value<ItemTemplate>                <asp:Label ID="Incidnet"  Text='<%# Eval("Incidnet").ToString() == "True" ? "1" :...

change value of label in a gridview based on a checkbox value
I have a gridview with a template column that is bound to a  database field thats a bit datatype.  I was representing it as a checkbox but I want to represent it as a label with a simple Y or N.   I've looked everywhere but nothing seems to be conclusive. Thanks!  Ahh I got it! I found this cool way to set the label to whatever you want depending if its true or not:  <asp:Label ID="lblWaivingCoverage" runat="server" Text='<%# (bool) Eval("WaivingCoverage") ? "Y" : "N" %>'><...

Based on selected value from HTML.Dropdownlist, the values to be fetched
Hi,  I'm using Html.DropDownList.  When selection within this box changes, I need to retrieve the values from table based on the selected id(datavaluefield) of dropdownlist. Here my code ViewPost.cs viewpage <%=Html.DropDownList("CategoryID",ViewData["CategoryID"])%>  ---- based on selected value from the user the below table should fetch the value the db <table>        <tr>                   ...

Text value not changing when new value on DropDownList selected
Hi, I am looking for assistance on how to correctly post events when a new item is selected on a drop down list. My drop down list has autopostback enabled and a sub routine associated with SelectedIndexChanged. This routine is activated when another entry in the drop down list is selected, however, the value is not changed and the drop down list returns to the originally selected value. For example, if I have 2 values in my drop down list, 0 and 1, and 0 is the currently selected value. Selecting 1 will trigger the event but the drop down list will return to displaying 0 as the selected ...

change one gridview cell text format based on another gridview cell value??
I have the following (I code in VB) in a datagrid nested inside a DataList: The hiddencolumn style prevents the CAB column/data field from showing in the browser. How do I make the "Consumer" datafield cell text be purple and italic if CAB is True or -1 in Access?? I code in VB, and I know the code has to be in the one of the row or data events of the gridview. Thank you, Tom Convert your Consumer to a template field with label, id = "Label1" then try using the RowDataBound event of the gridview and code something like: If e.Row.RowType = DataControlRowType.Data...

How Select one dropdownlist value using down arrows corresponding other dropdownlist value are select
I am using two dropdownlist box.One is used for country selection. other one is used for state selection.I am using dropdown selectedindexchanged event. when i click country dropdownlist corresponding state is selected in state dropdownlist box. How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.R.Karthikeyan   kartmca: How select the country in country dropdownlist using down arrow keys at the same time corresponding state is select in state dropdown list.Generally, we don't implmenet...

Web resources about - Change Another Column Value based on Dropdownlist selected value while gridview onrowediting -

Tag Synonyms - Stack Overflow
Q&A for professional and enthusiast programmers

Accidental entities - what about the UI?
This post is a follow-up to my previous blog post " Accidental entities - you don't need that identity ". In that post, we followed a consultant ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Air Astana - Join Now
Thank you for considering membership of Nomad Club – Kazakhstan’s first Frequent Flyer Program. You could soon be on your way to earning free ...

Languages -> C# Articles, Tutorials, Examples: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Blog - Avisra
Avisra Web Development Home Blog Services Contact The Blog Latest Module Builder: How can we make it better? Sitefinity by Chris on July 2, 2013 ...

Online Booking Tool Support
This Online Booking Tool Support page might help you as you navigate through the process of booking travel through your OBT provided by CWT. ...

@Html and beyond
... ); } return string .Format( “{0}{1}” , me.Member.Name, id); } The Html building methods are quite simple. Building a dropdownlist for a ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Unit Testing DateTime.Now Without Isolation
public virtual void SeedWithYearsSince(DropDownList list, int year){ for (int index = year; index

Resources last updated: 1/22/2016 11:31:54 AM