Solved

ASP.Net Gridview Filtering and Display

Posted on 2011-03-23
1
527 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
ID: 35202087
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
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…

740 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