Click or drag to resize

Table

The SecurityGrid component is designed to display financial information (level1 fields) and its changes relating to instruments in a tabular form. The component allows you to select one or more instruments.

Main properties

Please note that for the display of changes in market information, you must specify a provider of market data.

Below is the appearance of the component and the code snippet with its use.

GUI Security Picker 2

In the figure, the SecurityGrid component is shown in the SecurityPicker graphical component.

XAML
<Window x:Class="SecurityGridSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sx="clr-namespace:StockSharp.Xaml;assembly=StockSharp.Xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <sx:SecurityGrid x:Name="SecurityGrid"/>
    </Grid>
</Window>
C#
Connector _connector = new OpenECryTrader();

SecurityGrid.MarketDataProvider = _connector;

..........................

_connector.NewSecurity += security =>
{
    SecurityGrid.Securities.Add(security);
};

..........................

private void ColumnsFilter()
{
    string[] columns = { "Board", "BestAsk.Price", "BestAsk.Volume" };

    foreach (var column in SecurityGrid.Columns)
    {
        column.Visibility = columns.Contains(column.SortMemberPath) ? Visibility.Visible : Visibility.Collapsed;
    }
}