xml - Best Practice for saving a DataGridView after the contents of a cell have been deleted -


i have datagridview has text box column user can modify. running issue when user deletes text out of 1 of cells , tries save it, though obj ref error when tried access cell text deleted from.

the way got around when user done editing cell put handler on the "cellendedit" event. in method check see if cell isnothing set value empty string.

i wondering if best practice sort of thing.

you can set datasourcenullvalue property string.empty cell. when user deletes contents of cell, empty string automatically set in database. not have handle cellendedit event.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellstyle.datasourcenullvalue.aspx


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -