Solved

Hyperlink to pass value to RowFilter

Posted on 2011-03-22
1
182 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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