Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Grid question
Message
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00897206
Message ID:
00897303
Views:
13
You can do it by inserting TextBoxes into the cells of the DataGrid. I made a clickable DataGrid by inserting LinkButtons into the cells, which is easier. I get the cell text out of each cell of a row in the ItemDataBound event handler for the DataGrid, assign the primary key to the ItemCommand of the LinkButton, assign the cell text to the text of the LinkButton, bubble up the LinkButton's ItemCommand event to the containing form, and then pull the ItemCommand out of the DataGridCommandEventArgs to get the PK back. But clicking is only one-way. I use the primary key to load the data associated with the row to load the data into a form for editing, but you could do it all in the grid.

There are a lot of online resources. Try searching for

   "editable DataGrid" ASP

on Google and you'll get a lot of hits. There's a lot of sample code available.
David S. Alexander
Kettley Publishing
20271 SW Birch Street, 2nd Floor
Newport Beach, CA 92660-1752
Previous
Reply
Map
View

Click here to load this message in the networking platform