473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

making rows in a datagrid editable

Does anyone know of a way to allow a user to click on a cell within a
datagrid and then edit the contents of that cell? Nearly all the topics
I've come across on Google appear to be for the webform version of the
control. However, I'm using a winform one. If it makes any difference,
mine is bound to an ArrayList.

I've played aound with the click event and beginedit() for quite a
while now - so if anyone could give me a tip or too I'd really
appreciate it!

Greg.

Nov 17 '05 #1
2 1260
You need to implement your own type safe object collection in order to
enable editing, sorting and other databinding operations. Namely, you need
to enable IBindingList, and set AllowEdit to true.

See following MSDN article for detailed steps:
http://msdn.microsoft.com/msdnmag/is...g/default.aspx

--
Ming Chen
http://engdump.blogspot.com/
"Greg" <gr*************@yahoo.co.uk> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Does anyone know of a way to allow a user to click on a cell within a
datagrid and then edit the contents of that cell? Nearly all the topics
I've come across on Google appear to be for the webform version of the
control. However, I'm using a winform one. If it makes any difference,
mine is bound to an ArrayList.

I've played aound with the click event and beginedit() for quite a
while now - so if anyone could give me a tip or too I'd really
appreciate it!

Greg.

Nov 17 '05 #2
Thanks Ming. That implementation seemed quite lengthy - and after a bit
of fiddling with the datagrids properties I've managaed to make the
cells editable. I don't understand why I couldn't get that to work
earlier, but it seems to be fine now! Thanks - it was good to know the
PROPER way to do it!

Greg.

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andla Rand | last post by:
Hi, Could you help me to understand how datagrid works. I'm trying to make a datagrid editable. Now most of the tutorials I read says that i should turn the Enable ViewState off. Why is that? ...
4
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns...
0
by: DaveR | last post by:
I have a webform with a two-column datagrid based on an Arraylist. The Arraylist draws the data for the two columns from two different tables in an SQL database. The data is displayed in datagrid...
8
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long...
1
by: rkbnair | last post by:
To edit third record in a datagrid, we have to say: this.MyDataGrid.EditItemIndex = 1. However, is it possible to make all 20 rows editable at the same time?
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
6
by: Richard L Rosenheim | last post by:
I'm sure it can be done, I haven't been able to find the right article yet. I want to be able to filter the records that the datagrid displays, but still have an editable datagrid. That is, I...
1
by: Vili | last post by:
Hi all I am having problems with asp.net 1.1 and nested datagrid. I have a datagrid (dgDetail) nested inside a datagrid (dgMaster). How can I make all the rows editable in dgDetail? So that...
7
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.