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
40
How to Bind Button with Text in XamGrid.
posted

Hi Everyone,

I am working on XamGrid Infragistics and i want to display button with data in column . As shown in image.   

Parents
  • 28925
    Suggested Answer
    Offline posted

    Hello Vai,

    Thank you for contacting Infragistics. The XamGrid allows TemplatedColumns which expose a ItemTemplate and EditorTemplate for cells when in or out of edit mode.

    eg.

    <ig:TemplateColumn Key="UnitPrice">
                <ig:TemplateColumn.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding UnitPrice}" />
                    </DataTemplate>
                </ig:TemplateColumn.ItemTemplate>
    
                <!-- Set custom editor for column -->
                <ig:TemplateColumn.EditorTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical">
                            <!-- Set UpdateSourceTrigger to Explicit so that grid has control over when update to source occurs -->
                            <Slider x:Name="slider1" Minimum="0" Maximum="100" SmallChange="1" LargeChange="5" Value="{Binding UnitPrice, Mode=TwoWay, UpdateSourceTrigger=Explicit}"></Slider>
                            <TextBlock Text="{Binding Value, ElementName=slider1}" HorizontalAlignment="Center"/>
                        </StackPanel>
                    </DataTemplate>
                </ig:TemplateColumn.EditorTemplate>
            </ig:TemplateColumn>

    Let me know if you have any questions.

Reply Children