Only Edit Single Column in Gridview

  • Thread starter Thread starter randy.buchholz
  • Start date Start date
R

randy.buchholz

Hi Group,

I have a gridview in a monthly timekeeping application. The grid shows
twelve months of data and I need allow editing of only a single column, the
current month. I'm not sure where to start here.

TIA
 
I have a gridview in a monthly timekeeping application. The grid
shows twelve months of data and I need allow editing of only a single
column, the current month. I'm not sure where to start here.

In a Grid, you have the option of only having certain columns as editable
using the EditItemTemplate (make them labels instead of textboxes, for
example).

You can also create a form view for edit of a single record and place the
info from that column into a text box (showing the other information).

Either way will solve the problem.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
More info...

The setup is pretty simple. The only control on the page is the grid. I
have bound the grid directly to a SQL datasource and currently have no
template columns.
The gridview columns are 'person', 'assignment', and twelve month columns
(Jan-Dec).
The users can see all rows and columns from the database in the gridview and
can edit all rows using the built-in 'Edit' command. I want to restrict the
editable columns to only the one which represents the current month. The
approach I would like to use is something like:

1. Default all columns in gridview to readonly. (I know how to do this)

2. Look up column from current date.
Jan = 3, Feb= 4 (I know how to do this)

3. Enable the current column for edit.
I would like to edit only Jan with something like:
gv_thisgrid.columns[3].readonly = false
I can't find a way to access the 'readonly' attribute from the C# code.
I expected it to be at: gv_thisgrid.columns[X].'RightHere' Is there another
way to access it?

Thanks
 
Back
Top