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

Help with GridView/FormView databound to same SQLDataSource

G'day all.

I having a problem with my formview. I'll ty to explain my situation as best as i can.

I have a page with a search field at the top which is just a simple asp:textbox. Below that i have a gridview which displays the results of the search. if no search is entered, then the gridview shows all records. Below the gridview i have a formview for inserting and editing the records. when a user clicks on one of the records in the gridview, it will change the formview to edit mode and populate it with the record's details. This gridview/formview link is done by setting the formview.pageIndex = gridview.selectedIndex.

The way this works is as follows. I have the gridview bound to a sqldatasource (name = ProcIO). I also have the formview bound to the same sqldatasource. When the page loads, the gridview displays all records, and the user can click one to edit in the formview. This works fine. However, when the user inputs a search value, the gridview rebinds and display the records the user searched for, yet the formview will not rebind. The formview does not display the record the user clicked on the gridview, but the formview does display a record which was in the same index location when the gridview loaded all the records. This leads me to believe the gridview is rebinding, yet the formview is not.

The way i display the search results in the gridview is by changing the sqldatasource's (ProcIO) selectcommand to add in the sql WHERE clause to include the search value. This alone will cause the gridview to rebind/update with the search results, without calling the gridview.databind().

I have tried calling the formview.databind(), but with no luck. I am absolutely stuck on how to make the formview rebind to the sqldatasource with the new selectcommand.

I can post my source & code if it will help.

Thanks in advance.

Liam.
Mar 16 '07 #1
0 2112

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

Similar topics

0
by: Swetha | last post by:
Hello I have a FormView with InsertItem, EditItem and ItemTemplates. Depending on from where the page is accessed, the page opens up in either Insert, Edit or ReadOnly mode. The FormView is...
4
by: Alexander Widera | last post by:
Hi, I have the following source code: <%@ Register tagprefix="my" tagname="tcontrol" Src="article_small.ascx" %> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$...
4
by: P. Yanzick | last post by:
Hello, I've been playing with master/detail views as well as editing in the gridview, and I ran across a strange problem that I am not exactly sure where to go to try to solve. I have 2...
6
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im...
1
by: Andre | last post by:
Hi, I try to change some value in the databind of my formview, but can't find a way to dot it. In Asp.net 1.1 i was using someting like this : Public Sub item_bound(ByVal sender As...
3
by: Bas Paap | last post by:
I'm having a problem with formviews and DropDownLists in ASP.NET 2.0. I'm using a formview to insert an order into a database. Part of the order is the customer. Currently, I have a dropdownlist...
2
by: Dabbler | last post by:
In my Registrant FormView I have a DropDownList which loads data from a secondary SqlDataSource "sdsOfficeParks". I need the user to select an office park but save the selected value in the...
0
by: sgtmarcjones | last post by:
How do I access a dropdownlist that is nested within a Formview ItemTemplate Gridview Template? I want to see a label (lgbTimeKeep ! TextValue of ddlName dropdownlist) instead of a dropdownlist...
5
by: =?Utf-8?B?QWRhciBXZXNsZXk=?= | last post by:
Hi All, I have a GridView inside the EditItemTemplate of a FormView. Both FormView and GridView are data bound using an ObjectDataSource. When the FormView's ObjectDataSource object has a...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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.