Handling Events from Data Grid

G

Guest

I'm working on a Data Grid app. For a number of reasons (mostly aesthetic) I don't want to use the standard approach with Button Columns for doing updates on a row-by-row basis. I know I can create Template Columns that contain Web Controls. I want to handle postback events (TextChanges on a TextBox, for example) on Web Controls contained in a Template Column. Does anybody know of a way to write "AddHandlers" for those

Sample code, maybe?

Thanks in advance for any help
 
T

Teemu Keiski

Hi,

you can still write event handler declaratively (in aspx) even if control is
contained in a template. Second way is to locate controls in DataGrid's
ItemCreated event and wire the event handler there (by seraching the control
from DataGridItem and then assigning the event handler)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



Rich said:
I'm working on a Data Grid app. For a number of reasons (mostly
aesthetic) I don't want to use the standard approach with Button Columns for
doing updates on a row-by-row basis. I know I can create Template Columns
that contain Web Controls. I want to handle postback events (TextChanges on
a TextBox, for example) on Web Controls contained in a Template Column.
Does anybody know of a way to write "AddHandlers" for those?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top