1

I needed to add multiple buttons inside a single column in data grid view in WPF Application! In windows form application it could be able to do like this . That data grid view will load from DB. At same time , there will be 2 command buttons need to be added in each rowenter image description here

please anyone provide a way to accomplish this!

Thank you

1
  • 1
    Your question is more like a homework question. The way to do this is already available in MSDN Library. You should search the answer first in MSDN Library of WPF documentation first. Commented Aug 10, 2016 at 11:19

1 Answer 1

8

Include those 2 buttons in a stack panel to achieve what you want to get. See below code sample.

<DataGridTemplateColumn Header="2 Button Column" Width="200">
    <DataGridTemplateColumn.CellTemplate>
         <DataTemplate>
             <StackPanel Orientation="Horizontal">
                 <Button Name="Button1" Content="Button1" />
                 <Button Name="Button2" Content="Button2" />
             </StackPanel>
         </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.