asp.net.ph

ButtonColumn.DataTextField Property

System.Web.UI.WebControls Namespace   ButtonColumn Class


Sets or retrieves the field from a data source to bind to the text caption of the buttons in the column.

Syntax


Inline <asp:buttoncolumn datatextfield = strFieldName ... >
Script ButtonColumn.DataTextField = strFieldName

Property Value


strFieldName String specifying the name of a field from the data source to bind to the text caption of the buttons in the column.

The property is read/write with no default value.

Remarks

Use the DataTextField property to specify the field name from a data source to bind to the text caption of the buttons in the column. When the text caption is data bound to a field, the text caption of each button control in the column is set with a corresponding value in the specified field. This allows you to set a different text caption for each button control in the column. To specify the same text caption for each row in the column, set the Text property instead of this property.

NOTE: The DataTextField and Text properties cannot both be set at the same time. If both properties are set, the DataTextField property takes precedence.

When using data binding, you can specify a custom display format for the text caption of the buttons by setting the DataTextFormatString property.

See Also

ButtonColumn Members   Adding Button Columns to a DataGrid Control 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