asp.net.ph

CommandField.ShowSelectButton Property

System.Web.UI.WebControls Namespace   CommandField Class


.NET Framework version 2.0

Sets or retrieves a value indicating whether a Select button is displayed in a CommandField.

Syntax


Inline <asp:commandfield showselectbutton = true | false ... >
Script CommandField.ShowSelectButton [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true to display a Select button in a CommandField; otherwise, false. Default value is false.

Remarks

Use the ShowSelectButton property to specify whether a Select button is displayed for each data row in a CommandField control.

NOTE: This property applies only to data-bound controls that support select operations, such as the GridView control.

Clicking the Select button for a row selects that record from the data source, and sets the SelectedIndex property to the index of the row, and also sets a reference to the selected GridViewRow object via the SelectedRow property.

Note that for the automatic select feature to work, the DataKeyNames property must be set to specify the key field or fields of the data source that will identify the record to select.

When the ButtonType property of a CommandField is set to Button or Link, use the SelectText property to specify the text to display for a Select button.

Alternatively, you can display an image by first setting the ButtonType property to Image and then setting the SelectImageUrl property.

See Also

CommandField Members   ShowCancelButton   ShowEditButton   ShowInsertButton   ShowSelectButton Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph