当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Bind a char[] in WPF

问题描述:

I have a char[] propertie.

I would like to bind it, but i display "system.char[]" instead of the char[]value.

Here is my XAML :

<DataGridTextColumn Binding="{ Binding Path= strEvtNumero}" Header=" N° évènement " Width="Auto" IsReadOnly="True" />

Here is my propertie :

public char[] strEvtNumero

{

get { return m_strEvtNumero; }

set

{

m_strEvtNumero = value;

FirePropertyChangedEvent("strEvtNumero");

}

}

Have you an idea please ?

Thanks a lot :)

网友答案:

you can wrap it into another property

    string strEvtNumeroString
    {
        get
        {
            return strEvtNumero.ToString();
        }
        set
        {
            strEvtNumero = value.ToArray();
        }
    }

or use value converter

网友答案:

You can create a value converter to show the right value.

分享给朋友:
您可能感兴趣的文章:
随机阅读: