473,804 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select FormView row programmaticall y

11 New Member
Is it possible to select specific row of FormView control by DataKeyName or row ID from code behind programmaticall y.
Assuming that FormView is binded to standard ObjectDataSourc e control.

Thanks,
Daniel
Aug 5 '07 #1
4 6639
dizzy77
11 New Member
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 Recognized Expert Specialist
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 New Member
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 Objectdatasourc e.
Aug 9 '07 #4
kenobewan
4,871 Recognized Expert Specialist
An even better solution!
Aug 9 '07 #5

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

Similar topics

4
6823
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
3123
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 control with the appropriate CommandName. But, I want to decide this when the page loads, based on the selection made in a DropDownList on a previous page (basically selecting between a read-only view of an item, an item edit, or a new item)....
3
6047
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 "LabLocation_ID". With an existing lab, they then need to add the members for that lab. So, what I am trying to do is the following. With the FormView of the Lab open, the user will click a button to open a FormView (InsertMode) and add a new...
3
3436
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 values. The field values in the FormView are always overwritten by the results of the Update method in the business layer. No matter what I do, the databind always takes place, even when I don't want it to. See the example below. This is a...
0
2997
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 need to add my select parameters programmatically. Here are my 2 ControlParameters are they were originally : <SelectParameters> <asp:ControlParameter Name="Month" ControlID="ddlMonth" PropertyName="SelectedValue" />
3
5430
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 the FormView?
2
2391
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
2614
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 reference not set to an instance of an object. I am attempting to access the controls in my PagerTemplate using the following code: CType(Me.fviewPhotoAlbum.FindControl("lnkPhotoAlbum"), LinkButton)
3
3644
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" runat="server"></asp:Label></td> <td> <asp:TextBox ID="tbResponseText" runat="server" Text='<%#
0
9711
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.