Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello experts....

I have a grid containing columns "name,qty,rate,total" and the datagridview property is set to AllowUsersToAdd

when i manually enter details to column a new row is automatically generated,
but when i set the column values by programatically it doesnt generate a new row

how can i solve this?

I tried with editmode,But nothing works well for me
I tried google but the result is same...

Please help me with some code or references

Thanks in advance
Posted
Updated 6-Jan-14 21:41pm
v2

I suspect that after you add the row programatically you need to rebind the datagrid to the datasource.
 
Share this answer
 
Bind the datasource of the Grid using BindingList object.
Any modification to BindingList object (add/remove) will cause the component model object to refresh. So the UI element will auto refresh without calling any explicit methods in the backend.
 
Share this answer
 
Comments
crazytwister 9-Jan-14 2:22am    
sir please clarify more

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