Solved

ASP.Net Gridview Filtering and Display

Posted on 2011-03-23
1
528 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need syntax help building hyperlink 2 53
Securing WEBAPI on Azure 2 55
Left aligned $ and right aligned amount ASP.NET 7 43
dropdownlist in asp.net vb. 3 21
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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