How to check for new added row and values?

6 posts, 0 answers
  1. Diego
    Diego avatar
    3 posts
    Member since:
    Nov 2015

    Posted 30 Nov 2015 Link to this post

    Hi!

     

    Which action can I check after the users clicked on: " * Click here to add new row " and filled the collums, please?

     

    The first collum is readonly because its a ID, but the others must be filled to execute the action.

     

    I can't find the solution.

     

    Thank you!

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 30 Nov 2015 Link to this post

    Hello Diego,

    Thank you for writing.

    It is suitable to use the UserAddingRow event which allows you to validate the entered data and cancel the new row if data is not valid. Please refer to the following help article which is quite useful on this topic: http://www.telerik.com/help/winforms/gridview-rows-new-row.html

    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Diego
    Diego avatar
    3 posts
    Member since:
    Nov 2015

    Posted 30 Nov 2015 in reply to Dess Link to this post

    Hello Dess.

     Thank you for your help.

     I tryied the code on the example, but it doesn't worked:

     private void lvClientes_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
            {
                if (e.Rows[0].Cells["Nome"].Value != null && e.Rows[0].Cells["Idade"].Value != null &&
                    e.Rows[0].Cells["Email"].Value != null)
                {
                    MessageBox.Show("ok!");
                }
                else
                {
                    e.Cancel = true;
                }
            }

     

    For unknow reason the paramer GridViewRowCancelEventArgs isn't working, its red.

     

    What i did worng, please?

     

    Thank you!

  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 30 Nov 2015 Link to this post

    Hello Diego,

    Thank you for writing back.

    Could you please specify which is the exact version of the Telerik UI for WinForms suite that you are currently using?

    I am looking forward to your reply.

    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Diego
    Diego avatar
    3 posts
    Member since:
    Nov 2015

    Posted 30 Nov 2015 in reply to Dess Link to this post

    Hi Dess,

     

    Thank you!

     

    I'm using VS 2013 and Telerik version: 2010.1.10.308

  7. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 30 Nov 2015 Link to this post

    Hello Diego,

    Thank you for writing.

    The UserAddingRow event is not available for the version that you are using. I would recommend you to upgrade to at least Q2 2010 (version 2010.2.10.713) in order to benefit from the introduced functionality.

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready