Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:42:58+00:00 2026-06-04T18:42:58+00:00

I have the following code: <DataGridTemplateColumn Header="Security"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button Name="Security" Content="{Binding Path=totalSecurities}" Command="{Binding

  • 0

I have the following code:

<DataGridTemplateColumn Header="Security">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <Button Name="Security" Content="{Binding Path=totalSecurities}"
                    Command="{Binding Source={StaticResource viewModel}, Path=filterGridCommand}">
                <Button.CommandParameter>
                    <MultiBinding Converter="{StaticResource PassThroughConverter}">
                        <Binding Path="sector"/>
                        <Binding ElementName="Security" Path="Name"/>
                    </MultiBinding>
                </Button.CommandParameter>
            </Button>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

Below is the code for PassThroughConverter:

public class PassThroughConverter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameters, CultureInfo culture)
    {
        return values;
    }

    public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

When I debug as soon as it hits the return values line, the correct values are in the array
but when i press the button that triggers the filtergridcommand, the values returned are both null? Can anyone help. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:43:00+00:00Added an answer on June 4, 2026 at 6:43 pm

    Some experimentation confirms that doing this

    public object Convert(object[] values, Type targetType, 
                          object parameters, CultureInfo culture)
    {
        return values;
    }
    

    results in the command parameter ending up as object[] { null, null }.

    The converter is run every time a bound value changes, not when the command is executed, and the return value is cached for use when the command is executed. The original parameter object[] values appears to be reset to all nulls.

    The solution is to clone the values parameter. In your case you can do this:

    public object Convert(object[] values, Type targetType, 
                          object parameter, CultureInfo culture)
    {
        return new [] {values[0], values[1]};
    }
    

    More usefully, a variable number of values can be handled like this:

    public object Convert(object[] values, Type targetType, 
                          object parameter, CultureInfo culture)
    {
        return values.ToArray();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in XAML: <data:DataGridTemplateColumn> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image x:Name=picture Width=200 Height=130
I have the following code in my DataGridTemplateColumn: <Controls:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <StackPanel Orientation=Horizontal> <TextBox Text={Binding
I have following code: <style> .header { height:20px; width:100px; } .content { height:100px; width:100px;
I have the following XAML: <Window.Resources> <myApp:ImageDisplayConvertor x:Key=ImageDisplayConvertor /> </Window.Resources> <DataGridTemplateColumn Header=Icon> <DataGridTemplateColumn.CellTemplate >
I have following code class User attr_accessor :name end u = User.new u.name =
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
I have a following XAML: <DataGrid Name=nodeDataGrid ItemsSource={Binding NodeList} AutoGenerateColumns=False RowBackground=White AlternatingRowBackground=AliceBlue Grid.Column=1 HorizontalAlignment=Stretch
I have following code $("#in").datepicker({ minDate: 0, onSelect: function (dateText, inst) { dateText =
I have following code in button click Response.Write(window.open('Contact.aspx')); The above code is working.but if
I have following code: VAR1= ANOTHER_VAR=$VAR1/path/to/file ANOTHER_VAR_2=$VAR1/path/to/another/file ... # getopts which reads params from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.