Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every one,
trying to use a datagrid as data entry tool
the datagrid has 4 columns (code,name,price, quantity)
i try to add an empty row through code like this :
VB
datagrid1.items.add(new datagridrow)


but i get null reference exception...i really don't know why !
then tried
VB
datagrid1.items.add(new dataobject)

that does add a new empty row but doesn't allow me to edit the cells

so the question is how can i in runtime add editable empty rows ??
also how can i keep all the cells in edit mode all the time ??

(each column .isReadOnly property is set to false and also the datagrid same property)
(the exact message when trying to edit a cell is :
'EditItem' is not allowed for this view.)

Thanks for your time every one
Posted

:D
when you add it you must refresh it or forced it

before it better you must linked to database and then refresh from stored database

i suggest you datagrid not good for this usage you use linq for connection

and before read from text box to add in datagrid or dataview
 
Share this answer
 
Comments
Ahmad_kelany 1-Oct-13 9:14am    
thanks for your reply
i don't understand your answer very well though,
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900