Bound Datagrid new row event???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aaron Ackerman

    Bound Datagrid new row event???

    What event do I use in a bound Datagrid to capture the creation of a new
    Datagrid row??


  • Tian Min Huang

    #2
    RE: Bound Datagrid new row event???

    Hello Aaron,

    Thanks for your post. What's the type of DataGrid you are using, Web Form
    or Windows Forms?

    1. If it's in a Web Form, I suggest you to take a look at
    DataGrid.ItemDa taBound Event which is raised after an item is data bound to
    the DataGrid control. Please refer to the following KB article:

    HOW TO: Use the ItemDataBound Event of Web Forms List Controls in Visual C#
    .NET


    2. In a Windows Form DataGrid, based on my experience, there is no direct
    event will be fired when it creates a new row. As you know, when you type
    something in the last row of DataGrid, it will automatically add a new row.
    So you may be able to work around this problem by monitoring the Keystrokes
    in the cells of the last row in DataGrid. To trap the keystrokes to the
    cell in a DataGrid, please refer to the article below:

    HOW TO: Trap Keystrokes in .NET Controls by Using Visual C# .NET
    Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows, Surface, and more.


    Hope this helps.

    Regards,

    HuangTM
    Microsoft Online Partner Support
    MCSE/MCSD

    Get Secure! -- www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    Comment

    Working...