Solved

ASP.Net Gridview Filtering and Display

Posted on 2011-03-23
1
516 Views
Last Modified: 2012-05-11
I have a two questions. I was not sure if I should split them up or not. But I have a gridview in asp.net (c#). The girdview's datasource is a SQL Server view. I want to filter the gridview for the currently logged in user. I am using the membership model. How do I filter the data?
Second, with that same gridview, I want to dispaly the data in 2 columns. Is there a way to do this? It's returning only one column from the view, but the results can be many records. I'd ike to display it in two columns so it does not take up to much real estate. Thanks.
0
Comment
Question by:dodgerfan
1 Comment
 
LVL 7

Accepted Solution

by:
nbove earned 500 total points
Comment Utility
You can filter the data by putting an event handler on the "OnSelecting" event of your datasource and setting the value of a parameter to the current user.

You can add columns to a gridview through it's <Columns> tag.  You can have as many columns as you like specified.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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: …

763 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

6 Experts available now in Live!

Get 1:1 Help Now