Solved

how to display only a few columns after databind to a gridview control?

Posted on 2014-12-19
2
265 Views
Last Modified: 2014-12-19
Hi, I'm using VS2012, C# and asp.net.
I have a collection,  List<UserPrincipal>, that I use as a datasource and binded to the gridview, by code.  I only want to show 6 columns of data and allow users to edit only 5 of those columns.  How can I do that?  Is gridview the best control to use for this?  Users should be able to update the userPricipal object in edit.  How to do that too?

Thank you.
0
Comment
Question by:lapucca
2 Comments
 
LVL 33

Accepted Solution

by:
Mike Eghtebas earned 500 total points
Comment Utility
< GridView Task
   Edit Columns
   From Selected Fields: select FirstName (for example)
   On the right in BoundField properties: set ...
   - Visible: False

if this is the column you do not want to be displayed.
0
 

Author Closing Comment

by:lapucca
Comment Utility
Thank you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

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

7 Experts available now in Live!

Get 1:1 Help Now