473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

passing the value of dropdownlist into gridview

Greetings everyone, I have a dropdownlist populated by my database, below is my code:
Expand|Select|Wrap|Line Numbers
  1. <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsNames" 
  2.                 DataTextField="Name" DataValueField="Id">
  3.             </asp:DropDownList>
  4.             <asp:SqlDataSource ID="dsNames" runat="server" 
  5.                 ConnectionString="<%$ ConnectionStrings:dbProfilesConnectionString %>" 
  6.                 SelectCommand="SELECT Lname+', '+Fname AS Name,Id FROM tblProfile">
  7.             </asp:SqlDataSource>
Beside my Dropdownlist, I have a button and below I have a Gridview, what I want to achieve is whenever I select one of the name in my Dropdownlist, then when I click the button the name should be added in gridview. I am using asp.net with c#. Any help would be appreciated. Thanks in advance. God Bless :)
May 29 '13 #1
0 1082

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mike | last post by:
how can i get datakey value of GridView ??????? protected void BookGridView_RowDataBound(object sender, GridViewRowEventArgs e) { int tableId = int.Parse( BookGridView.DataKeys.ToString() ); ...
0
by: SDRoy | last post by:
Hi Can someone help me to figure out how to get the editable textbox value from GridView in my code-behind ? I am using the code something like- GridView2.Rows.Cells.Text.Trim(). But when I...
2
by: sangram | last post by:
Passing value from parent to child window created by Pop up
14
by: Mike | last post by:
I have a gridview that has a button in the last cell of each row. I want to get the text from cell 1 for that row the button was clicked on. So if my gridview looks like this: N-12 BMW ...
1
by: renatois | last post by:
Getting value from GridView Hi guys, I have a GridView and I need to access a value of an ID field on an event. I converted this field into template and the name of the label control in...
4
idsanjeev
by: idsanjeev | last post by:
SIR I AM PASSING VALUE FROM ONE FORM TO ANOTHER FORM THROUGH COOKIES BUT IS CAN ONLY TRANSFER LAST VALUE HOW CAN PASS VALUE AFTER CLICKIN ON LINK I AM USING THE CODE IS FOR LINK <td><a...
1
by: tina2626 | last post by:
how can i pass textbox value to gridview using C#.net at runtime not using database values. i m hving textbox1 and gridview1. can anyone suggest me to do this coding in ASP.NET(C# language).
2
by: minhtran | last post by:
HI all Please, anyone has any idea how to get value from gridview in ASP.NET using VB.Net. I use C# as a code Gridview1.SelectedRow.Cell(i).Text , it works but not on VB.NET. If any one can help me...
1
by: sva0008 | last post by:
hi , I am using. <input type=button class=tbox value="Populate SA" style="width: 90%"...
0
by: baburmm | last post by:
Hai, I want to get the footer textbox value in gridview using javascript any one help me Regards, Babu.K
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.