473,386 Members | 1,679 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,386 software developers and data experts.

Select FormView row programmatically

11
Is it possible to select specific row of FormView control by DataKeyName or row ID from code behind programmatically.
Assuming that FormView is binded to standard ObjectDataSource control.

Thanks,
Daniel
Aug 5 '07 #1
4 6612
dizzy77
11
Why do I need this?
I have my records listed in GridView and FormView on separate pages.
I like to have Edit button on GridView on each row and when clicked then open FormView page with same set of records and opened target row for editing.
Now how do I make the last part - select exact record on FormView.

Thanks,
Daniel
Aug 8 '07 #2
kenobewan
4,871 Expert 4TB
One way would be to pass the value to the page and use request query or form, depending the method. This is better done with a unique id. HTH.
Aug 8 '07 #3
dizzy77
11
Actualy it's easy, FormView has PageIndex property that controls shown record and setting it to GridView's Selected index property value will do the trick. Assumnig both Formview and GridView are populated with same Objectdatasource.
Aug 9 '07 #4
kenobewan
4,871 Expert 4TB
An even better solution!
Aug 9 '07 #5

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

Similar topics

4
by: genc ymeri | last post by:
Hi, I have a tab control with several pages. How can I select pages programmatically ??? I ran : .................... Mytabcontrol.tabpages.select () or Mytabcontrol.tabpages.show()...
1
by: Random | last post by:
In the ASP.NET 2.0 beta, the FormView control has the ItemTemplate and InsertItemTemplate areas (and others). All the documentation I've found says the way to toggle between the views is to use a...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
0
by: Mike P | last post by:
I am using a GridView with 3 SelectParameters 2 of which are ControlParameters, but the third of my SelectParameter values is derived through my code rather than a QueryString, Control etc, so I...
3
by: Jeff | last post by:
hey asp.net 2.0 I want to programmatically populate (with data from the database) a label control in a FormView on a webpage. Is it a good idea to put my logic inside the DataBound event of...
2
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
2
by: Nathan Sokalski | last post by:
I am trying to create a FormView controls in which I access and modify the the controls in the PagerTemplate programmatically. However, I continue to recieve the following error: Object...
3
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.