Solved

Hyperlink to pass value to RowFilter

Posted on 2011-03-22
1
181 Views
Last Modified: 2012-05-11
In my Page_Load I have the following code

DataTable dt = GetDataTable(@"c:\fans.csv");
DataView dv = dt.DefaultView;
dv.Rowfilter = "Name = 'Xname'";
GridView1.DataSource = dv;

This works and display on the gridview only the person by Xname... but I'd like to do this dynamically. Please help!

Is there a way to pass a value dynamically by a hyper link to sort the gridview?

dv.Rowfilter = "Name = 'Xname'";   would receive the Name value from a hyperlink

Thank you!
0
Comment
Question by:portalvale
1 Comment
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 500 total points
Comment Utility
Hi,
Yes, you can use Rowcommand event for this as.
Pass the CommandName="Sort" on hyperlink,
Pass the Field Name as CommandArgument on hyperlink
and in rowCommand Event apply the filter and rebind the grid
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now