Getting control value inside the grid at the post back

Hi,

      I used the DropdownList control inside the gridview and i want to retrive the value of dropdown in gridview at the page postback. Is it possible to get the value using "Request.Form"? or is any other method to reteive the value?. Looking for help

 

Thanks

1
Spider
10/23/2008 12:11:36 PM
asp.net.presentation-controls 72751 articles. 2 followers. Follow

1 Replies
588 Views

Similar Articles

[PageSpeed] 37

 Dropdownlist ddl = (Dropdownlist)gridview1.rows[gridviewrowno].FindControl("dropdownlistid");

string selvalue  = ddl.SelectedValue;

 

in above you have to change  gridviewrowno to the rowno you wants to retrieve.

dropdownlistid to the id of the dropdownlist in gridview.

may be you required to chagen the property "SelectedValue"  also.


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
1
ramireddyindia
10/23/2008 12:17:47 PM
Reply:

Similar Artilces:

Getting the control id of a control inside gridview control
 uhmm.. a little bit confusing regarding my subject because i dont know how to say it...by the way my problem is how can i get the id of a control (e.g. textbox) inside the gridview... and the textbox is in the templatefield... is there any way i can get its id??  hoping i could get a reply as soon as possible... Regards,MhaeyPlease remember to click “Mark as Answer” on the post that helps you.. =) What do you want's to do by getting the id of the Text box? Do you want's to find particular Textbox with certain id ? Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MC...

How to maintain form controls value after user control post back?
 hello experts, I have created filter grid in asp.net & C#.My form design has contains 3 dropdown controls and Filter grid(User control).Its working fine(filter), but one problem arise.the form controls are clear when i filter a grid(post back).I tried to reterive values using view state, hidden controls, i got only null values.Anyone please help, its urgent to me. Its my user control code.FilterGrid.aspx<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FilterGrid.ascx.cs" Inherits="FilterGrid" %><style type = "text/css&...

How to get value from dynamic control on Post-back
Hi All, This is my first post. The problem is about dynamic control. 1. In Page Load, I auto generated a datagrid.  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         Dim lmws As New LIMSWSV10.LIMSService         Dim ds As New DataSet         If Not IsPostBack Then             ds = lmws.GetResultValueForShippingJob(Request.QueryString("ShippingJobID")) ...

How to get table control values on post back event?
Hi, I am using table control in asp.net, there are 3 columns in the table, values of first two columns are added manually at design time and third column has text box where user needs to add values. On button click event i need to save table (cell) values of column2,column3, but some how on post back event values are disappearing in the table. There is no limit on rows, it can be one or 20 depends on user selection. Is there any way to save table values on post back event or can i disable post back event for button so that table values will not be disappeared? Thanks ...

Value of Control created dynamically is not getting populated on post back
Hi I am creating a table at run time. If I put some value to textbox, its not getting populated after post back. If I do it on Page onInit event everything works fine.. but I cant do this as I have to make rows on button click. The code is like this Sub MakeTable() Dim ht As New Hashtable ht("1") = "1" ht("2") = "2" For i As Integer = 0 To 2 Dim tr As New TableRow For j As Integer = 0 To 1 Dim td As New TableCell Select Case (j) ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

How do I get get values of controls inside datalist?
How do I get values of controls inside datalist?   For example, if I have a label inside header template or item template or footer template? Is there anyway to change property of label or any other controls inside those template as well? I would really appreciate if anybody can just post a sample code or a helpful link about datalist? Would really like to know more about the events fired for datalist, itembound, itemcreating etc?   hey there,I used this page to work out how to use datalists http://www.eggheadcafe.com/tutorials/aspnet/d89d1d96-03f1-4784-bbb2-a3db1af...

getting focus back to the same control after post back
Hi friends!  How the control can be set focused on the same conrol after post back from where it was generated?thanks At the event of the control which causes Postback , add {        ControlID.Focus() } in this wayprotected void Page_Load(object sender, EventArgs e) {if (IsPostBack) {Control control = null; string ctrlname = Page.Request.Params["__EVENTTARGET"];if (ctrlname != null && ctrlname != String.Empty) { control = Page.FindControl(ctrlname); control.Focus(); } }   }   Note this will work for all...

Menu control : Cross page posting and posted values in nested controls?
I've created a dyrnamic template for a menu control which renders either a textbox or a linkbutton. The textbox acts as an search input field. The value of this field then acts as input to another page(on another frame actually). What happens is that clicking on the linkbutton will do a postback to Main.aspx(which resides in a frame called 'MainWindow'). When the value arrives at Main.aspx, I see the value from 'searchMovies' textbox posted into the Request.form collection as : 'NavigationMenu$ctl05$searchMovies' with the value that was keyed in. From main.aspx, does anyone know...

getting properties of controls inside a table control
Hi, I h ave a Table control "tbl" in which I am adding other controls such as textboxes and labels dynamically. I am trying to access the propertiesof the controls, such as label1.text and textbox1.text , that I dynamically created and added into the table control. The tbl has two columns, in the first column it has labels and textboxes in the second one Is there anyway I can access the properties of all the controls that I added in different columns and rows of table control by looping through the table. Something like, string temp; for(int i-0;i<=(num...

Control.Value and Control.SelectedItem.Value
Can someone explain to me the difference between say, Dropdownlist.SelectedItem.Value and Dropdownlist.SelectedValue?? Just curious, Thanks!Tim These are going to return the same thing. dropdownlist.selectedvalue is a shortcut to get the currently selected value in the dropdown. If that is all you want then you can just use that. If you want to access the currently selected item you can use dropdownlist.selecteditem and that return the item and you can then access any of the item's properties, including in this case the value property. If this post answered your question please r...

How to do post back in a dynamically created user control [provided that update panel is in the master page of the page where user control is added] {B/C of FileUpload Control}
I have a register my scriptmanager and place the update panel around contenttempalte for my pages int the master page. Now in one of my pages i am adding some user controls dynamically. In two of my user user controls I have FileUpload control which will not work under partial post back. So I want's full postback for them How could I do that {Provided that i am on the user control,which is inside the page ,and page have the contenttemplat...

Help getting control name and value of dynamic controls
I have an application which creates a dynamic form consisting of an html table with web controls in the page. I need a user to be able to fill in this form and then grab the values of each control and save both the control name and the control value to a database. This is the Code that I have Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If not ispostback then Dim infotable As New Table Dim objparticipant As New Participants.ParticipantInfo Dim objCustomFields As New CustomFieldController Dim TypeId As Intege...

TextBox control not retaining values inside Wizard Control
I might be doing someting very silly. I have a wizard control. Everthing works fine on Wizardstep 1 . But on the step 2 I have some TextBoxes and a Button. When I click on the button a page postback happens and then there is nothing in the TextBox.Text property in the code behind.   Thanks I notice the status of this thread is “Resolved”, is it marked yourself? If so, please post your answer in order for others member learn from it.  We will greatly appreciate all your sharing.Hong-Gang ChenMicrosoft Online Community SupportPlease remember to mark the replies as answers if the...

Web resources about - Getting control value inside the grid at the post back - asp.net.presentation-controls

George Clayton Johnson, Writer of First ‘Star Trek’ Episode, Dies at 86
George Clayton Johnson, who wrote the script for the first “Star Trek” episode to air and co-wrote “Logan’s Run,” died Tuesday in the Los Angeles ...

Another British Muslim Prevented from Flying to the United States Without Explanation
A British imam has accused the U.S. State Department of enacting Donald Trump’s proposed ban on Muslims “before he has received a single vote,” ...

Vegas newspaper stands up to its newly unveiled owner, casino giant Sheldon ...
Los Angeles Times Vegas newspaper stands up to its newly unveiled owner, casino giant Sheldon ... Los Angeles Times Reporters for the Las ...

Cruz blasts Washington Post cartoon depicting daughters
TULSA, Okla. (AP) — A Washington Post editorial cartoon depicting Ted Cruz's 5- and 7-year old daughters as monkeys is inappropriate, and the ...

David Cameron should have delivered in this year's Christmas message, STEPHEN GLOVER writes
In his latest Christmas message, David Cameron appropriates ‘Jesus Christ — the Prince of Peace’ to justify bombing Syria, writes STEPHEN GLOVER. ...

Facebook’s Free Internet Service In India Hits A Speedbump
Facebook launched free mobile Internet earlier this year in February through Internet.org, but it seems that India’s regulators are rather cautious ...

Steve Harvey’s Miss Universe Blunder Gets ‘Curb Your Enthusiasm’ Treatment
It was only a matter of time. We may never know why Steve Harvey mistakenly named Miss Colombia the winner of Sunday’s Miss Universe pageant, ...

Black Lives Matter Protesters Block Minneapolis-St. Paul Airport, Angering Christmas Travelers
Black Lives Matter protesters shut down the airport in Minneapolis, disrupting travel on one of the busiest days of the year and angering scores ...

The airing of the automotive grievances
Filed under: Etc. , Humor , Videos As is a Festivus tradition, the Autoblog editors air some of their automotive grievances. We've got a lot ...

Over 3,000 prisoners let out early thanks to software glitch
More than 3,000 prisoners in Washington State over the past 13 years have received the best Christmas gift they could have hoped for: Early freedom. ...

Resources last updated: 12/24/2015 4:13:12 AM