
Using TemplateFields in the GridView Control:
Step 2-Displaying the First and Last Names in a Single Column
This VIDEO TUTORIAL will outline the process in which the last name and first name of the employee are shown in one column of GridView display at run time instead of separate columns. This accomplished by converting the first name filed of the GridView display to template field column from the Edit Fields link on the smart tag menu of the GridView control. This process initiates the inclusion of EditItemTemplate and ItemTemplate fields in the declarative mark up of the GridViewTemplateField.aspx page by replacing the data bound field. In order to append the last name to the first name in the design mode of the GridView control, click on the smart tag menu of the GridView and click on the Edit Template link. From the Template Editing mode drop down list, first name ItemTemplate can be selected. Following which, another label server control can be dragged and dropped next to the first name field. This newly added label is customized using its smart tag menu and clicking on Edit DataBindings link. This will initiate the launch of databindings wizard and aids in assigning lastname field to the newly added label. This concludes in displaying first name and last name in one column of the GridView. For detailed information and source code for this step, please refer to the original article.
This video presentation is available ONLY for REGISTERED users of this web site due to significant costs associated with data transfer of multimedia content. Please register to view this video. Registration is FREE of charge and takes less than a minute to complete. Thanks for your consideration.
---Administrator