Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid

Status
Not open for further replies.

RicksAtWork

Programmer
Nov 1, 2005
120
GB
Is it possible to edit a datagrids content from the perspective of columns rather than rows?
 
You can make more than one row editable at a time, so I think that would acheive what you are trying to do. See the following article for more info:



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Basically - a while back I wrote a timesheet app.

You currently edit by row (job type) instead of by column (day).

The users want to be able to edit by day, rather than row - however I cant have all rows open to edit, since we would end up with upto 500 textboxs for editing.

Is there no way I can just say, I'd like to edit the Monday Column?

 
Did you look at the example in that article?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You can have the entire grid editable if you want.
For instance you can have a column with a checkbox and others with textboxes.


Use a column with visible=false that contains your key.

In the submit button click:
for each item as datagriditem in DataGrid1.items

dim Customer_ID as string = item.cells(0).text
dim chk as Checkbox=ctype(item.findcontrol("MyCheckbox"),checkbox)
'Now you have the customer id and you can access your controls for each record the rest is just updating your database.

next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top