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
1500
How to use image instead button content in a custom button column
posted

Hi,

I create a custom button column follow Devin Rader -

http://blogs.infragistics.com/blogs/devin_rader/archive/2010/07/08/creating-custom-columns-for-xamgrid.aspx

I want to use a image instead button content like

But I do not know how to set the Image Source in the Custom ButtonColumn.

 

Parents
  • 6912
    Suggested Answer
    posted

    Hi,

    Check the attached sample. I added a new property to the ButtonColumn class - ContentTemplate and made a minor change to the ResolveDisplayElement method in ButtonColumnContentProvider.

    Using the following markup:

    ...
    <ig:XamGrid.Columns>
        <local:ButtonColumn Key="Btn" Click="ButtonColumn_Click">
            <local:ButtonColumn.ContentTemplate>
                <DataTemplate>
                    <Image Height="16" Width="16"
                           Source="Assets/cross.png" Stretch="None" />
                </DataTemplate>
            </local:ButtonColumn.ContentTemplate>
        </local:ButtonColumn>
        ...

    You will get the following result:

    Hope this helps

    BtnColumnForum.zip
Reply Children
No Data