Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firing events in controls nested inside a DataGrid

Status
Not open for further replies.
Dec 29, 2001
73
GT
Hi folks,
I have a TextBox inside a Template Column in a DataGrid. Its binding works fine but I can´t handle events thrown by it. Documentation states something about "bubble events" saying that it should be thrown as a DataGrid.ItemCommand event. However my handler for this event is not being executed after I change the text of the textBox (for instance). I found one way to add a handler directly to the control in the ItemCreated event, however it was done in C and I'm using VB. Is there a way in which I can achieve the same result?

Thanks a lot,

Mauricio Peccorini
 
MP: post your C# code, we'll take a look at it; and yes, the bubbling event should be at play here (first guess).
 
In C# the code is something like the following:

TextBox tBox;
tBox = ...(look for the control inside the datagrid's cell)
tBox.textChanged += MyTextBoxChanged()
...

Of course you have to define a procedure called MyTextBoxChanged.

It appears to be adding a new event handler programmatically. However I can't do the same in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top