Initiates a connection between the DataGrid and its associated source and loads records from the data source into the DataGrid.
DataGridObject.DataBind()
Newlook Smartclient
Newlook Server
None.
This method is useful if you would like to filter the records displayed in the datagrid based on values the user has entered.
If the DataGrid is already connected to a data source when the DataBind method is called, then the DataUnbind method will automatically be called. All existing rows (other than header rows) within the DataGrid will be removed and the DataGrid will then attempt to connect to the database using the connection string defined in the DataGrid properties (this may require further user input for passwords, etc.). The method returns once the connection has been made, but the DataGrid will continue to load records in the background until it has loaded all records.
Returns a Boolean indicating the success or failure of the action.
The following function filters the records displayed in the datagrid based on the text entered by the user. JSCRIPTfunction FilterCustomerRecords() { var strKey = App.ActiveForm.txtCustomerKey.Text; var intLength = strKey.length; if (intLength > 0) { App.ActiveForm.grdAttachmentsList.Source = "SELECT * FROM DocumentList WHERE EntityRef='" + strKey + "'"; } else { App.ActiveForm.grdAttachmentsList.Source = "SELECT * FROM DocumentList"; } var bindSuccess = App.ActiveForm.grdAttachmentsList.DataBind(); }
VB SCRIPTSub FilterCustomerRecords()
End Sub |
DataUnbind method | Source property
© 2004-2021 looksoftware. All rights reserved.