| ||
English | Slovak |
Menu: | |||||||||
|
Components of Px Framework: Row search in the PxWebQuery component according to the value entered and the name of the column where the search shall be carried outIf you need to search in the table of the PxWebQuery component, you can do it via the Find command, see the example below:
if(wquAdresar.Find("%ško%","name")!=-1)
Definition of the Find command:
public Int32 Find(string SearchValue,string sFieldName);
Description of the Find command parameters: The return value of Find command is ItemIndex (row index, which corresponds to the selection criteria) of the PxWebQuery component, if no row is found, the return value then is -1. SearchValue - value, according to which the search is, in the column specified in the parameters sFieldName. SearchValue value, we can arrange for example. percent "%" functionality is similar to the SQL command "Like" sFieldName - column name, which is the search string Then, the PxWebQuery component enables search according to the primary key, please refer to the example below:
if (wquAdresar.FindByIdPK(6)!=-1)
The return value of the FindByIdPK command is ItemIndex (row index, which corresponds to the selection criteria) of PxWebQuery component, if no row is found, the return value then is -1. The valid value of the primary key is entered as a search parameter. Setting of the cursor position in the row in the PxWebQuery and PxSuperGrid componentsSetting of the cursor position in the PxSuperGrid component can be carried out by assigning the 0..RecordCount-1 value to the ItemIndex property of the PxWebQuery component to which the PxSuperGrid component is linked.
if (wquAdresar.FindByIdPK(6) != -1)
Selection of several rows that match the selection criteriaThe PxWebQuery component allows also to select more than one row, if it is possible due to the selection criteria . The wquAdresar.DataSource () command returns the DataTable object. The DataTable object supports selection, row selection. For more information please refer to the example below:
//Statement IDs lines that match selection criteria
This routine shall bring us the list of all IDs of the rows, which match the selection criteria, in this case, these are the rows, which contain the letter "a" in the text of "name" column. Here is a functional example of the PxWebQuery component, even with source code. This functional example on this site runs on MySQL 5.0 database.
Others articles of Px Framework:
It doesn't the intention of this part website, describe in detail the work with PxFramework components, a detailed description of the component available in manual, which can be downloaded here: Download manual of Px Framework |