• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

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

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
TonyReba
Asked:
TonyReba
  • 4
  • 3
1 Solution
 
jdfultonCommented:
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
 
TonyRebaAuthor Commented:
How can I make only a few columns editable??
0
 
jdfultonCommented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
TonyRebaAuthor Commented:
I just see emptydatatemplate and pagertemplate.
0
 
jdfultonCommented:
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
 
TonyRebaAuthor Commented:
I am using vs 2010 , i re configured the data source but didnt see the convert to template option>?
0
 
jdfultonCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now