📘
TimeLine E3
  • TimeLine E3 Documentation
  • Framework
    • Introduction
    • DataSet Definition
    • Window Handling Object
      • Input/Output arguments
      • Open
      • BindDataControls
      • Item Changes
      • Item Search
      • MenuItemClicked
      • Print
      • ModuleOpened (BlueArrow)
      • BlueArrowArguments
      • New Row
      • Delete Row
      • Save
      • Transactions
      • Locking [deprecated]
      • Locking (new)
      • Resizing a response window
      • ParaPanel
      • Adding DMS Tab to a Module
    • BusinessObject
    • Controls
      • BindingFormat
      • LookupGrid and SearchDef
      • ComboBox
      • RadioButton
      • Multiline Textbox
      • xTextBoxSearch
      • xFileBrowse [v16+]
      • DxDispoColumn
      • DxProgressColumn
      • DxTemplateColumn
      • Change control caption programmatically
      • TabControl
      • Navigation
      • Enable controls programmatically
      • Enable a MenuItem programmatically
      • Filter search values
      • Jumping to another module
      • Messages, Notifications, Log, Exceptions, Translation
      • LoggerSink [deprecated]
      • Log
      • OpenFile, FolderBrowsing and SaveFile
      • Execute Actions while displaying an Hourglass
      • Using Progress
      • Async methods with progress bar
      • Wizard
      • Customizing controls using xBehaviors
      • TLProperty.AllowInReadOnly [v16+]
    • DataSet Operations
    • Business-related functionality
      • Getting the next primary key
      • Hybrids
      • Enums
      • Get Current User
    • SQL
    • SQL (using named parameters)
    • Advanced SQL
    • Expression Binding
    • Server-side logic & customization [v16+]
      • Service Hoster
      • Starting / stopping hosted services
      • Changes to scheduled jobs!
      • Business Object Proxies
      • Business Object API
    • Colors in Expression Bindings [v15+]
    • Theming
      • Icons
  • TimeLine Developer (TLD)
    • Debugging in TLD
    • Targets
    • Custom Project Rework [v16+]
  • TimeLine-specific LL functions
  • Stunnel proxy
    • Pre-requisites
    • 1. Initial setup
    • 2. Generate the server/web certificates
    • 3.a. Generating client certificates using the CSR flow
    • 3.b. Generate client certificates from the server console
    • 4. Setting up the E3 client connection
    • 5. Setting up the browser certificates
  • Configuration
    • Configuring the WCF timeout
  • Troubleshooting the E3 Bridge
  • [Deprecated]
    • TimeLine WEB - deprecated in v16+
      • Prerequisites for running the WASM modules on the server
      • Prerequisites for developing WASM modules with TLD
      • Creating a small web module with TLD
      • Terminal Configuration
    • Customization Examples - deprecated in v16+
    • Codestore [deprecated]
    • Configuring the scheduled jobs timeout - deprecated in v16+
Powered by GitBook
On this page
  • Multiselection
  • xTextBoxSearch MultiSelection
  • xTextBoxSearch NoResultFound
  1. Framework
  2. Controls

xTextBoxSearch

PreviousMultiline TextboxNextxFileBrowse [v16+]

Last updated 3 years ago

Multiselection

For selecting more than one rows in a DataGrid, check the IsMultiSelect property of the control:

The row collection can be accessed as follows:

//IEnumerable of DataRows, containing all the selected rows from the DataGrid
var selRowsOt = dxgStueckOverview.SelectedRows;        
foreach (var item in selRowsOt)
    rowList.Add(item);    // one DataRow    

xTextBoxSearch MultiSelection

When setting the IsMultiSelect property on the xTextBoxSearch, the control will contain a collection of rows in the ExtraRows property. The value provided in ItemChanged control should be retrieved, while each element in the ExtraRows property must be added.

When performing search using F8/F9 on the control or by clicking on the search icon, the first row in the selection goes into the newValue/SelectedRow, while the 2nd row until the last are added in the ExtraRows property. When performing a drag & drop from the Navigator, the 1st row until the last are added in the ExtraRows property.

In order to avoid adding the same information twice, the control exposes the “RetrieveCurrentValue” property, which controls whether the newValue/SelectedRow shoud be loaded

public override void ItemChanged(UIElement container, FrameworkElement element, object selectedItem, object newValue, object oldValue)
{
    base.ItemChanged(container, element, selectedItem, newValue, oldValue);

    if (Equals(element, tbsArbgkatNrPos))
    {    
        BusObj.RetrieveArbgkat(afoRow, newValue.ToString());
        
        // Multiselection 
        foreach (var arbgRow in tbsArbgkatNrPos.ExtraRows)
        {
            var arbg = arbgRow["id"].ToString();
            if (arbg != newValue.ToString())
            {
                var newAfoRow = BusObj.NewBabAfo(SelectedStlPosition);
                BusObj.RetrieveArbgkat(newAfoRow, arbg);
            }
        }
    }
}

xTextBoxSearch NoResultFound

This event is triggers when no result is found following a search.

public override void Opened()
{
   base.Opened();
   tbsBetriebsauftrag.NoResultFound += TbsBetriebsauftrag_OnNoResultFound;
}

On the Opened method you attach to the TextBox.

protected void TbsBetriebsauftrag_OnNoResultFound(object sender, EventArgs e)
{
    var searchedBaNr = sender as string;

    var message = string.Empty;
    if (searchedBaNr.ToInt(0) != 0)
    {
        var baRow = Sql.SelectRow("select status, typ, art from bab where bab.nr = :babNr", new { babNr = searchedBaNr });
        if (baRow == null)
        {
            message = l.Translate("Betriebsauftrag {0} ist nicht vorhanden.", searchedBaNr.ToInt(0));
        }
        else
        {
            var status = baRow["status"].ToInt(0);
            var baTyp = baRow["typ"].ToInt(0);
            var art = baRow["art"].ToInt(0);

            if (baTyp != Enums.BabTyp.Betriebsauftrag || !art.In(Enums.BabArt.Einzelprodukt, Enums.BabArt.Koppelprodukt, Enums.BabArt.Nacharbeitsauftrag, Enums.BabArt.NacharbeitsauftragKoppelproduktBetriebsauftrag))
            {
                message = l.Translate("{0} ist nicht als Einzel-/Koppelbetriebsauftrag geschlüsselt.", searchedBaNr.ToInt(0));
            }
            else if (status == (int)EnumBaStatus.Abgewickelt)
            {
                message = l.Translate("Betriebsauftrag {0} ist abgewickelt.", searchedBaNr.ToInt(0));
            }
        }
    }

    Log.Error(l.Translate("Fehler beim Laden des Betriebsauftrags. {0}", message));
    tbsBetriebsauftrag.CommitChanges();
    NewKopf();  // reset RM
}

The implementation of TbsBetriebsauftrag_OnNoResultFound, sender will have the searched text, on searchedBabNr = sender as string. This implementation is found in wndRM