Solved

Filtering based upon template field value

Posted on 2010-09-20
3
373 Views
Last Modified: 2012-05-10
Hi,

I have the following setup.  An ObjectDataSource which is used to populate a Details view control.

This is current used for inserting data.  One of the fields iwithin this is a template field into which I have placed calendar extender control.

Here is what I want to achieve. Add a gridview control on to the same page that when the page loads shows all of records from the table.  I then wish this gridview to be filtered when a user makes a selection from the date templatefield.

Thinking about this I need to first capture the event of adding a date.  I take it this will be on change event of the textbox rather then onClick of the calendar extender control.  Not sure how to access template field controls inside a details view?

Next I need some way of filter the ObjectDataSource of the new gridview.  I have setup a query that accepts a parameter but normally I can specify to take the parameter from a control, but in this case I won’t be able to because it’s inside a details view control.

Any help much appreciated.
0
Comment
Question by:andyw27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 33717971
Not getting the scenario you are trying to use these controls. Generally you use GV->Detailsview but here you are trying to use DV->GV.

You can find the control in DetailsViews like you would normally do.
e.g
TextBox tb = (TextBox )DetailsView1.FindControl("txtDate");

For setting the parameter value programmatically check this:
http://www.asp.net/data-access/tutorials/programmatically-setting-the-objectdatasource-s-parameter-values-cs
0
 

Author Comment

by:andyw27
ID: 33719183
Thanks, I still can't see how to do something on the event of a template field?

Your code allows me to find a control, great if I want to change it's attribute, but how for example could I access the onchange event?

Thanks again.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 33719204
---> I then wish this gridview to be filtered when a user makes a selection from the date templatefield.
Where is your TB, inside GV? If you want to filter data, you can put that filter outside of GV.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question