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

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&nbsp...

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)
...

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...

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