Only Edit Single Column in Gridview

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
 
G

Gregory A. Beamer

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,
 
R

randy.buchholz

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top