----------------------------------------------------------- New Message on MumbaiUserGroup
----------------------------------------------------------- From: Swapnil_B1 Message 1 in Discussion Form View Control FormView is a data-bound user interface control that renders a single record at a time from its associated data source, optionally providing paging buttons to navigate between records. It is similar to the DetailsView control, except that it requires the user to define the rendering of each item using templates, instead of using data control fields. The main difference between DetailsView and FormView is that DetailsView has a built-in tabular rendering, whereas FormView requires a user-defined template for its rendering. The FormView and DetailsView object model are very similar otherwise. Like DetailsView, FormView keeps track of the current item being rendered, and can optionally support paging over multiple data items when the data source returns a list. The FormView supports automatic Updates, Inserts, and Deletes through its associated data source control just like the DetailsView control. To define the input UI for editing or inserting, you define an EditItemTemplate or InsertItemTemplate in addition to the ItemTemplate. In this template you will data bind input controls such as TextBox, CheckBox, or DropDownList to the fields of the data source. Data bindings in these templates use a "two-way" data binding syntax, however, to allow the FormView to extract the values of input controls from the template in order to pass to the data source. These data bindings use the new Bind(fieldname) syntax instead of Eval. Important: A control that is data-bound using the Bind syntax must have an ID property set. The FormView supports the DefaultMode property for specifying the default template to display, but by default the FormView starts in ReadOnly mode and renders the ItemTemplate. To enable UI for transitioning from ReadOnly mode to Edit or Insert mode, you can add a Button control to the template and set its CommandName property to Edit or New. From within the EditItemTemplate, you can add Buttons with CommandName set to Update or Cancel to commit or abort the update operation. Similarly, you can add Buttons with CommandName set to Insert or Cancel to commit or abort the insert operation. We use the FormView control for display a single record from the data source; there are seven types of Templates in which most of the Templates are optional. You must create a Template for the mode in which the FormView control is configured. For example, a FormView control that supports updating records must have an EditItemTemplate defined. Types of Templates: HeaderTemplate: Header Template defines the contents which we want to display in the header row of the FormView Control. FooterTemplate:Footer Template defines the contents which we want to display in the footer row of the FormView Control. ItemTemplate:ItemTemplates defines the contents for the FormView row when it is in read only mode. This template basically used for display the existing data from the data source. InsertItemTemplate:InsertItemTemplates defines the contents for the FormView row when it is in insert mode. This template contains the input controls and commands for inserting the new record. EditItemTemplate:EditItemTemplates defines the contents for the FormView row when it is in edit mode. This template contains the input controls and commands for editing the existing record. EmptyDataTemplate:EmptyDataTemplate basically used for showing the alert to the user if there is no record in the bound column. PagerTemplate:PagerTemplate defines the content for the pager row when the "AllowPaging" property is true. It also contains the controls by using that, user can navigate to another record. Swapnil (swaps) http://swapsnet.spaces.live.com/ ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
