Answered how to insert new row

  • Wednesday, March 07, 2012 6:54 AM
     
     
    how to insert new row in the last row have data in data grid view

    wael shazly

All Replies

  • Wednesday, March 07, 2012 7:36 AM
     
     

    Wael, 

    That is completely depending from how you have populated (added rows to) your datagridview

    So show us something around that. In the way your current question is, you can get 50 replies from which no one fits.


    Success
    Cor

  • Wednesday, March 07, 2012 7:45 AM
     
     

    wael shazly

  • Wednesday, March 07, 2012 8:51 AM
     
     
    Yes Cor is right, give us detail, like how you fill DGV, is DGV in Edit mode or not.  

    Art Of Living Is Art Of Giving

  • Wednesday, March 07, 2012 10:41 AM
     
     

    Wael,

    If I ask this kind of question I mean, how did you do it using code or by using the designer and then from what class it is populated (database, entity framework or whatever). 

    Showing a part of the populated datagridview does not show anything, beside that I see you write normally in that from right to left.


    Success
    Cor

  • Thursday, March 08, 2012 8:10 AM
    Moderator
     
     Answered

    Hi Wael,

    Welcome to the MSDN forum.

    If you’re trying to add new row to DGV by codes, you can create a new row then set values to each cell and then add the row to DGV.  I’d suggest check the related link: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/969fc761-d115-4772-aa72-a5f70e0442d7/ .

    If your DGV was bound to data source, you want to add new row and update it to data source. Please check this link : http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/8db841fc-ffa7-4519-b6f5-d054c7190948

    If I misunderstood anything, please feel free and feedback. I’d appreciate it if you could provide more detailed information about your project.

    Best regards,


    Shanks Zen
    MSDN Community Support | Feedback to us