Image and Text in Same Cell

2 posts, 0 answers
  1. Mehran
    Mehran avatar
    1 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 Link to this post

    hi
    how can i use image and text in same Cell?
    like this
    (Image)-MyName
    (Image)-ID
    ????
  2. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 29 Jan 2015 Link to this post

    Hello Mehran,

    Thank you for contacting us.

    To achieve your goal you could use a CellTemplate like in the code snippet below:
    <telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn.CellTemplate>
            <DataTemplate>
                <StackPanel>
                    <TextBlock Text="{Binding TextProp}"/>
                    <Image Source="{Binding myImgSourcePath}"/>
                </StackPanel>
            </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>
    </telerik:GridViewDataColumn>

    For further reference please check the Setting Cell Template and Cell Edit Template documentation article.

    Let me know if you need any further assistance.

    Best Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top