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

I have a user control that have a grid and link to pop up window to add into a grid
because of some reason when I add a record, before insert it in database, I want to show it in grid then I want to insert it in database.

When in update mode I want to bind grid from database and show new record in grid too.

Can you help me?
Posted
Updated 19-Apr-11 2:52am
v3
Comments
Sandeep Mewara 19-Apr-11 5:09am    
Good... go ahead and try. Do tell us and share the code where you get stuck.
Henry Minute 19-Apr-11 8:54am    
Without seeing how your grid is currently data bound, it is difficult to suggest changes/improvements/alternatives.

Please edit your question to include, at least, the binding part.

1 solution

Well, If your data source is a list, then you can easily implements this one. For example I have class clsA with several properties & I have a function like:
MIDL
public List<clsA> GetAll( )
{
 List<clsA> dataList = new List<clsA >();
 //populate the list with data and after that you can add records into the list
 //And finally this will be the data source of your dataGrid control.

return dataList;
}
 
Share this answer
 

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