Solved

How Do Edit the width of the "Update View"  Gridview on an asp.net 3.5 web page

Posted on 2010-11-08
7
200 Views
Last Modified: 2012-05-10
I want to reduce the width on the cells in an gridview control. I was able to do this for the display template, but once the user clicks on edit , the width is much bigger.
0
Comment
Question by:TonyReba
  • 4
  • 3
7 Comments
 
LVL 6

Expert Comment

by:jdfulton
Comment Utility
You should be able to do this via the gridview row editing command in the code behind or in the editing row style in the properties of the control.  It should be no different for the display template.  When you edit the template you should see the edit columns also. However columns that the data values are to large may override your changes.  Can you provide your code?
0
 
LVL 9

Author Comment

by:TonyReba
Comment Utility
How can I make only a few columns editable??
0
 
LVL 6

Expert Comment

by:jdfulton
Comment Utility
In the gridview templates view you can change the editable controls (ie text boxes etc... to label controls so they only show the data.  You should also probably change your datasource so it doesn't update the fields also.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 9

Author Comment

by:TonyReba
Comment Utility
I just see emptydatatemplate and pagertemplate.
0
 
LVL 6

Expert Comment

by:jdfulton
Comment Utility
Did you convert your columns to template fields after you setup your datasource?  You can do this by editing the columns in the gridview.  Select the column and then check the convert to template box.  They should then be available.
0
 
LVL 9

Author Comment

by:TonyReba
Comment Utility
I am using vs 2010 , i re configured the data source but didnt see the convert to template option>?
0
 
LVL 6

Accepted Solution

by:
jdfulton earned 500 total points
Comment Utility
Ok attached are two screenshots from VS2008.  First you edit the gridview top right of gridview and select Edit Columns.  Second image show the Convert to template.  It is actually a link instead of a checkbox.
gridview1.bmp
gridview2.bmp
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

Read about why website design really matters in today's demanding market.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 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

10 Experts available now in Live!

Get 1:1 Help Now