PDA

Click to See Complete Forum and Search --> : [RESOLVED] Datagrid problem


wiadus
Dec 12th, 2008, 08:17 AM
Hi I have a dategrid on my form and I can't edit any cell in the datagrid could any one help me out.
thanks

petevick
Dec 16th, 2008, 05:12 AM
Is it a bound grid?
How is it populated?

wiadus
Dec 17th, 2008, 05:13 AM
Is it a bound grid?
How is it populated?

Yes it is bond to a dataset and it is populated upon selecting somethngfrom a combobox which selectedvalue is the value to the command value.

petevick
Dec 17th, 2008, 09:27 AM
http://msdn.microsoft.com/en-us/library/ms180748.aspx should help for VS2008, or for VS2005 you can provide a invisble control for data entry (TextBox, ComboBox, etc) and then handle the "DoubleClick" event for the DataGrid. In that handler, use the DataGrid.CurrentCell to determine your current cell. Then, set the bounds of your TextBox (or other control) to DataGrid.GetCellBounds. Finally, you can copy the contents of the cell to your TextBox, Select it, make it visible, and edit away - does that help?

wiadus
Dec 17th, 2008, 05:10 PM
Thanks very much