How to get selected index of dropdownlistboxs present in two different rows of gridview

I have a gridview, in that i have dropdownlistbox as one column.  Without editing the grid view i want to know the selected index of dropdownlistbox for each row.

0
chandra
10/15/2007 11:56:13 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
733 Views

Similar Articles

[PageSpeed] 56

See http://forums.asp.net/t/1170088.aspx.


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

0
ecbruck
10/15/2007 1:10:35 PM
Reply:

Similar Artilces:

How to get the row index of a selected row in listview control
Can someone please tell me how to get the index of a selected row in a listview.  <ItemTemplate> <asp:LinkButton runat="server" class="linkButton" id="xxxxx" Text='<%#Eval("documenttype") %>' CommandName="OpenFile" CommandArgument='<%#Eval("DocumentKey") %>'></asp:LinkButton></ItemTemplate>what you have to do is, in itemcommand event of ListView, you have to get the value of row indexif(e.CommandName == "corrospondingcommaandname"){     &nb...

How to bind gridview depending on the selected value of dropdownlistbox present in same gridview.
I have a gridview, in that ihave dropdownlistbox as acolumn. Depending on the selected value of dropdown list box i want to bind the grid view. I know the concept that we need to bind the grid in selected index change of dropdownlistbox, But i am not getting the dropdownlistbox inside the selectedindex changed event of dropdownlistbox. How i can get the selectedindex of dropdownlistbox present in gridview.  Use the sender parameter to retrieve a reference to your DropDownList like so: protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)...

How to delete row from GridView control
Hello,  I am working on an ASP.NET 2.0 app, and I am trying to wire up a "Delete" button to a gridview control on a form. Here is the code for the ASP :  <asp:GridView ID="gvInConditions" runat="server" AutoGenerateColumns="true" OnRowDeleting="gvInConditions_RowDeleting" DataKeyNames="Condition_ID" >         <Columns>                <asp:CommandField ButtonType="Button" SelectText=&...

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

Get Selected row index in gridview
i have this code RowCommand Event from Gridview  protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)  {               int index = ????;         if (e.CommandName.Equals("Select"))         {             Server.Transfer("~/Admin/TampilAnggotaDetail.aspx");         }         else if(e.CommandNa...

How to get the index of the selected row in gridview?
Hi, can anybody tell why this code doesn't work?   <asp:GridView ID="showCompanies" runat="server" DataSourceID=".." DataKeyNames=".." OnRowCommand="showcompanies_RowCommand"><Columns> <asp:ButtonField CommandName="c0" ButtonType="Button" Text="Company" /> ... </Columns> </asp:GridView>   code behind:Sub showcompanies_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Dim row As GridViewRow = showCompanies.SelectedRow Dim i As Integer =...

getting selected row index of gridview?
hi how are you .. I want to get the index of selected row of GridView. Such that the page must not be postback. rather after selecting row, i have an button 'Edit' Outside the gridview (i.e. it is not a template item of gridview). this means agter selecting a row on gridview, when i click 'Edit' button, it must get the index of selected row of gridview and then get the Item at that index. how can i do that ?Thanks  From my understanding there is no single "item" at the selected. There is simply a row. You can get that row by:   In your Gridview add an e...

Gridview
I have a parent and child gridview.  When a button is clicked on the parent  gridview it will open the child gridview and populate it with records based on which row the button was clicked.  What I need to do is get the index of the selected row so that I can then get the DataKeyNames value (as it is a foreign key) in order to populate the child gridview accordingly.  This is what I have come up with, but it doesn't seem to work for me - the e.CommandArguments returns a string with no value, so I get a conversion error when I try to convert it to an int.  If ...

Getting the row index of a command in gridview control
In my gridview I have a textbox and a save icon which allows a user to enter a date and click save which saves the date to the database for that record pointed to in the row. The problem I have is that I don’t know how to get the row to process the save in the codebehind. Normally I would set the command-argument equal to the product ID and then in the codebehind handle the event where the commandname matches the commandname for the save icon. I have the problem then though of not knowing which row caused the event. If I use a buttonfield, I know it sets the commandargument to the row index...

Problem in Using DropDownList Control to select a selected row of SqlDataSource that is under GridView Control
Hi all,In my SQL Server Management Studio Express, I have a database "ChemDatabase" that has a table "LabData"  formatted in the following way: SampleID int PRIMARY KEY, SampleName nvarchar(25), ChemicalName, nvarchar(25), Concentration decimal(6.2) with 5 rows of records in this .dbo table. In my Visual Web Developer Express, I created a website "RPD-TCE" for extracting a row of record from the LabData table by using a DropDownList, a GridView and a SqlDataSource.  I want to click DropDownList to list one number of S...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

How to get data from two different tables for two different columns of a gridview based on datakey
Hi All,            I have a Gridview with two different columns- "Faculty" coming from tblFaculty and "Teachers" coming from tblFacultyTeacherLink. I want to get data for "Teachers" by comparing FcaultyId in tblFacultyTeacherLink and then getting Teachers name. How to achieve this without using nested gridviews?  My .aspx Page is as-   <asp:GridView ID="gviewFaculty" DataKeyNames="FacultyId" AutoGenerateColumns="false" runat="server" Width="100%&q...

How do the different data presentation controls equate in ADO.net?
How does Visual Studio create ado.net equivalents of the datagrid's and gridview's columns and rows?  I am assuming they make a DataRow for each of the rows.  Am I on the right track with this?Is the table created by gridview basically a dataset from ADO.net?  Can anyone offer any guidance with this?Thanks to everyone that has ever helped me with any posts. Hi newbie2C#, The row in datagrid is called DataGridItem and in gridview is called GridViewRow. They are all inherits TableRow Class. DataRow is only one kind of row in GridView control. There are many other t...

Web resources about - How to get selected index of dropdownlistboxs present in two different rows of gridview - asp.net.presentation-controls

Resources last updated: 12/30/2015 4:07:05 AM