Components of Px Framework:
PxCheckBoxList - component to view and select values from the list
The PxCheckBoxList component has many similar properties such as PxEdit component.
Therefore, it makes no sense to describe them in details, you can read the chapter on the PxEdit component.
Things that were described in detail when dealing with the PxEdit component, we will pass here only by telegraph, briefly.
With the PxCheckBoxList component we can automatically edit a column of a row in the table, which
is loaded in PxWebQuery component. We create a file AddAdresar.aspx, and write the following definition
of PxCheckBoxList component into the file:
<Prx:PxCheckBoxList ID="chlCar" runat="server" AddTableRow="True" />
In AddAdresar.aspx.cs file we define the connection PxCheckBoxListu components with
the PxWebQuery component, and its link to a specific table column.
protected void Page_Load(object sender, EventArgs e)
chlCar.PxDataSource = wquAdresar;
chlCar.FieldName = "Z_COLOR";
The PxCheckBoxList component supports automatic loading of value from
the PxWebQuery component, and automatic storage of selected value into
the database after execution of the Post() command on the PxWebQuery component.
Because the PxCheckBoxList component enables to select a single item from the list
it is possible to select (enter) on the PxWebQuery component how these conditions
are displayed and entered into the database. For the definition the parameter
named method AddParamCheckList
method is a method of PxWebQuery component.
Description of the parameters of the AddParamCheckList method:
Description of the parameters:
public void AddParamCheckList(string aFieldName, string aFieldNameKey, string aFieldNameValue, string aFieldToView, string aFieldToDB, string aPxWebQueryName)
public void AddParamCheckList(string aFieldName, string aFieldNameKey, string aFieldNameValue, string aPxWebQueryName)
- name of a column in the table on which method AddParamCheckList is applied. The best way is to assign the size varchar (500) to this column in the database.
- name of the code list column that represents the key of the code list
(the name of this column can be detected from the SQL command that is entered into the PxWebQuery component in which the code list is loaded)
- name of the code list column that represents the value of the code list column (the name of this column can be detected from the SQL command that is entered into PxWebQuery component in which the code list is loaded)
- the name of the column which value will be diplayed will be displayed in the Grid (PxSuperGrid) is entered here when selecting multiple items, these items are displayed separated by commas in the Memo component (TextBox).
- the name of the column which value will be entered into the database is entered here when selecting multiple items, these items are entered one after the other and are separated by commas.
-name of the PxWebQuery component in which the command code list is loaded via SQL, it is suitable to properly identify each column as Key and Value, for greater clarity
Example of AddAdresar.aspx.cs file in the Page_Load method:
wquAkcia.AddParamCheckList("Z_COLOR", "IDCOLOR", "COLOR_NAME", "wquListOfColor");
After the imposition of the parameter AddParamCheckList to the PxWebQuery component
and connection of the component PxCheckBoxList, this component can automatically
load data from the parameter and the selected value is automatically saved into the database.
The AddTableRow, TableBegin and TableEnd properties, which are described in detail in the section dealing with the PxEdit component, are used once again for the alignment of the components.
Caption name or titles of the columns in the Grid (Title) can be defined centrally during the definition of the PxWebQuery component, where the value in square brackets is the name of the column:
Changing the PxCheckBoxList (Label) caption:
wquAdresar.Columns["COLOR_NAME"].Caption = "Color Name";
Besides central definition, the PxCheckBoxList component caption can be changed in the following way:
chlCar.Caption = "Color Name 2";
The PxCheckBoxList component has OnlyCheckBoxList
property, that enables to
display the PxCheckBoxList component in two ways, if it is not in the state of editing.
If the value True is entered into the property OnlyCheckBoxList
the component is
displayed as a CheckBoxList as in the state of editing.
If the value False is entered into the property OnlyCheckBoxList
is displayed as Memo (TextBox), and selected individual values are entered in
a row and separated by a comma as shown in the picture below.
chlCar.OnlyCheckBoxList = false;
Through the SeparatorSumText
property of the component PxCheckBoxList we can control
visual display of the values separator when it is displayed in the Memo component
(TextBox) and entered into the database.
The default value is comma "," or you can type a semicolon ';'.
chlCar.SeparatorSumText = ",";
The PxCheckBoxList component allows filtering of displayed content of the code list
through the Filter
property. The names of the code list columns (fields)
of the PxWebQuery component are used in the Filter
chlCar.Filter = "CurrentState=1";
After entering this command only those items that have in the code list column
of the PxWebQuery titled "CurrentState" given value "1" are displayed
in the PxCheckBoxList component.
Others articles of Px Framework:
- PxWebQuery - component for working with databases
- PxSuperGrid - component for the direct display of data in the table
- PxEdit - component for data editing, similar to the TextBox component
- PxComboBox - component for selecting data from a list, similar to the DropDownList component
- PxCheckBox - component for checking the value (Check / UnCheck value)
- PxFlyComboBox - set of the consecutively linked comboboxes, suitable for the work with structured data (for example: selection of category and subcategory)
- PxGreatRepeater - component for entering data with repeating structure, maximum number of values is limited
- PxDbNavigator - the component for the work with the PxWebQuery components, row cursor movement, etc.
- PxLabel - component for data display
- PxCheckBoxList - component to view and select values from the list
- PxRadioButtonList - component for view and selection of a value from the list
- PxChart - the component for displaying and working with charts
- PxFilterView - visual component for filtering the table data contents in the PxWebQuery component
- PxUploader - component for uploading binary and text files to the server
- PxLogin - component for authorization and logging into the application
- Data loading from the Oracle, MSSQL, MySQL, FireBird, Interbase database by means of the PxWebQuery components
- Program inserting, editing or deleting of row into the database by means of the PxWebQuery component
- Loading values from the PxWebQuery component via the while cycle
- Row search in the PxWebQuery component according to the value entered and the name of the column where the search shall be carried out
- The "ReOpen" procedure of the PxWebQuery component and data re-load into the PxWebQuery component
- Validation, checking of the entered values by means of the PxWebQuery component and other visual components (PxEdit, PxComboBox, etc.)
- Events of the PxWebQuery component
- A special function GetValueFromStructKey of the PxWebQuery component
- Setting the language mutation of the Px Framework
- Finding the current version of the 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