Bound Datagrid new row event???

  • Thread starter Thread starter Aaron Ackerman
  • Start date Start date
A

Aaron Ackerman

What event do I use in a bound Datagrid to capture the creation of a new
Datagrid row??
 
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.ItemDataBound 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
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317582

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
http://support.microsoft.com/?id=320584

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.
 
Back
Top