Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
XamComboEditor Multiple Selection
posted

Hi

We are using XamComboEditor  in some of our XmaDataGrid columns.

We would like to allow multiple selection while using the XamComboEditor (the selection is done using checkboxes(.

How can we do that? 

we are going to  save the data as string ( value1;value2;value3...)

how the binding works?

(i've read aboud a property called AllowMultipleSelection  but i  think it is available only for the web Silverlight control)

Parents
No Data
Reply
  • 435
    posted

    Hi

    I've been checking the issue again and the problem is as follows:

    There Are 2 infragistcs XamComboEditor:

     

     

     

     

     

    public class GetComboDataSource : IMultiValueConverter

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    {

     

     

     

    public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo

    culture)

    {

     

     

     

    ProjectViewModel pvm = values[0] as ProjectViewModel

    ;

     

     

     

    Dictionary<string, ProjectColumn

    > projectColumns = pvm.ProjectColumns;

     

     

     

    string columnName = values[1] as string

    ;

     

     

     

    object

    cellValue = values[2] ;

     

     

     

    if

    (projectColumns.Keys.Contains(columnName))

    {

     

     

     

    switch ((string

    )parameter)

    {

     

     

     

    case "ValueList"

    :

     

     

     

    return

    projectColumns[columnName].ColumnValueList.ValueList.DefaultView;

     

     

     

    case "DisplayMember"

    :

     

     

     

    return

    projectColumns[columnName].ColumnValueList.DisplayMember.ToUpper();

     

     

     

    case "ValueMember"

    :

     

     

     

     

    if (cellValue != null

    )

    {

     

     

     

    foreach (DataRowView row in

    projectColumns[columnName].ColumnValueList.ValueList.DefaultView)

    {

     

     

     

    if

    (row.Row[projectColumns[columnName].ColumnValueList.ValueMember.ToUpper()].ToString() == cellValue.ToString())

     

     

     

    return

    row;

    }

    }

     

     

     

    break

    ;

     

     

     

    default

    :

     

     

     

    return null

    ;

    }

     

    }

     

     

     

    return null

    ;

     

     

     

     

     

    Infragistics.Windows.Editors.XamComboEditor

     

    XamDataGrid cell editor.

     

    Infragistics.Controls.Editors.XamComboEditor

     

     

    Apparently Infragistics.Windows.Editors.XamComboEditor is native to XamDataGrid
    and could be set as an editor in A grid.
    the problem is that Infragistics.Windows.Editors.XamComboEditor don't have multiple selection and AutoComplete capabalities.

    On the other hand

    Infragistics.Controls.Editors.XamComboEditor has this capablities but it's very hard to set it as

     

    Can u show me a code example how can i set  Infragistics.Controls.Editors.XamComboEditor  as a XamDataGrid Editor? including binding DataSource , DisplayMemeber and ValueMemeber?

     

     

     

    My code So far.

     

    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="comboEditor">

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    <Setter Property

    ="Template">

     

     

     

     

     

    <Setter.Value

    >

     

     

     

     

     

    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter

    }">

     

     

     

     

     

    <ig:XamComboEditor AutoComplete="True" IsEditable="True" AllowFiltering="True" SelectionChanged="XamComboEditor_SelectionChanged" BorderBrush

    ="Transparent" >

     

     

     

     

     

    <ig:XamComboEditor.ItemsSource

    >

     

     

     

     

     

    <MultiBinding Converter= "{StaticResource getComboDataSource}" ConverterParameter

    ="ValueList">

     

     

     

     

     

    <!--Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}"/-->

     

     

     

     

     

    <Binding ElementName="projectGridControl" Path

    ="DataContext" />

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Field.Name"/>

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Value"/>

     

     

     

     

     

    </MultiBinding

    >

     

     

     

     

     

    </ig:XamComboEditor.ItemsSource

    >

     

     

     

     

     

    <ig:XamComboEditor.DisplayMemberPath

    >

     

     

     

     

     

    <MultiBinding Converter= "{StaticResource getComboDataSource}" ConverterParameter

    ="DisplayMember">

     

     

     

     

     

    <!--Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}"/-->

     

     

     

     

     

    <Binding ElementName="projectGridControl" Path

    ="DataContext" />

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Field.Name"/>

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Value"/>

     

     

     

     

     

    </MultiBinding

    >

     

     

     

     

     

    </ig:XamComboEditor.DisplayMemberPath

    >

     

     

     

     

     

    <ig:XamComboEditor.SelectedItem

    >

     

     

     

     

     

    <MultiBinding Converter= "{StaticResource getComboDataSource}" ConverterParameter

    ="ValueMember">

     

     

     

     

     

    <!--Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:XamDataGrid}}"/-->

     

     

     

     

     

    <Binding ElementName="projectGridControl" Path

    ="DataContext" />

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Field.Name"/>

     

     

     

     

     

    <Binding RelativeSource="{RelativeSource TemplatedParent}" Path

    ="Value"/>

     

     

     

     

     

    </MultiBinding

    >

     

     

     

     

     

    </ig:XamComboEditor.SelectedItem

    >

     

     

     

     

     

    </ig:XamComboEditor

    >

     

     

     

     

     

    </ControlTemplate

    >

     

     

     

     

     

    </Setter.Value

    >

     

     

     

     

     

    </Setter

    >

     

     

     

     

     

    </Style

    >

     

     

     

Children