Handling Events from Data Grid

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
Back
Top