Solved

Hyperlink to pass value to RowFilter

Posted on 2011-03-22
1
183 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
ID: 35193421
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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