Components of Px Framework:
PxRadioButtonList - component for view and selection of a value from the list
The PxRadioButtonList component has many similar properties as the PxEdit component.
Therefore, it makes no sense to decribe them in details, you can read the chapter on PxEdit component.
Things that were described in detail when dealing with the PxEdit component,
we will pass here only by telegraph, briefly.
With the help of the PxRadioButtonList component we can automatically edit the column
of the row in the table which is stretched in the PxWebQuery component.
We create AddAdresar.aspx file and the following definition of the PxRadioButtonList component into it:
AddAdresar.aspx file:
<Prx:PxRadioButtonList ID="rblCar" runat="server" AddTableRow="false" CaptionOnTop="True" Width="150" />
In the file AddAdresar.aspx.cs we define the connection of the PxRadioButtonList
component with the PxWebQuery component , and its link to a specific column in the table.
AddAdresar.aspx.cs file:
protected void Page_Load(object sender, EventArgs e)
{
rblCar.PxDataSource = wquAdresar;
rblCar.FieldName = "Z_COLOR";
}
The PxRadioButtonList component supports automatic loading of the value from
the parameter of the PxWebQuery component and automatic storage of the selected
value into the database when the command Post() on the PxWebQuery component is executed.
The PxRadioButtonList component enables selection of only one item from the list,
therefore it is possible to specify on the PxWebQuery component how these conditions
are displayed and entered into the database.
The parameter with the name of the method
AddParamRadioList is used for definition.
The
AddParamRadioList method is a method of the PxWebQuery component.
Description of the parameters of the AddParamRadioList method:
C# syntax:
public void AddParamRadioList(string aFieldName, string aDataKey, string aDataValue, string aFieldToView, string aFieldToDB)
Description of the parameters:
aFieldName - name of a column in the table on which method AddParamRadioList is applied.
aDataKey - name of the column in which a string of keys separated by semicolons is entered, in this case is "1;2"
aDataValue - name of the column into which a string of values is entered separated by semicolons
in the same order as the key values have been entered. In this case it is "Red;Blue". This text will be displayed also in individual buttons in the PxRadioButtonList component
aFieldToView - the name of the column which value will be diplayed will be displayed in the Grid (PxSuperGrid),in this case the text "Value" and "Key".
aFieldToDB - the name of the column which value will be entered into the database is entered here, in this case the text "Value" and "Key".
Example of entry in the AddAdresar.aspx.cs file in the Page_Load method:
wquAkcia.AddParamRadioList("Z_COLOR", "1;2", "Red;Blue", "Value", "Key");
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:
wquAdresar.Columns["Z_COLOR"].Caption = "Color a Name:";
Changing the PxRadioButtonList (Label) caption:
Besides central definition, the PxRadioButtonList component caption can be changed in the following way:
rblCar.Caption = "Color a Name 2";
If we want to place the caption of the PxRadioButtonList component over
the component body (as it is shown in the image above), we use the property
CaptionOnTop, the example below:
rblCar.CaptionOnTop = true;
The PxRadioButtonList component was also equipped with a reset button that
is activated by setting the
ThreeState property to "true".
The reset button is used to reset the contents of the PxRadioButtonList component.
rblCar.ThreeState = true;
The PxRadioButtonList component with the reset button is shown in the picture below.
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
- PxJSDatePicker - component for the date entry, based on the JavaScript
- 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