?
Solved

Hyperlink to pass value to RowFilter

Posted on 2011-03-22
1
Medium Priority
?
188 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

831 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