Editing In Place Using Templates

For columns belonging to the TemplateColumn class, you can define a special template that is applied when one cell of such a column is being edited. In previous examples, I built a templated column that displayed data obtained by merging the first and last names with the title of courtesy. When you need to edit the content of a heterogeneous column like that, provide a template that includes each input control. For example, you might want a drop-down list supplying all the possible values for the titleofcourtesy column. You also must use separate text boxes for the first and last names. The following code creates a possible edit template:

 <edititemtemplate>     <asp:dropdownlist runat="server" id="ddTitles"  ...

Get Building Web Solutions with ASP.NET and ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.