Hi,
i want to add the button control to the xamdatagrid header. i have created the template and apply as the label presenter style in xamdatagrid.
when i applied the style then grid header is not display the line between two columns in header and also fixlocation sign is not display
i have created the below style.
<Style TargetType="{x:Type igDP:LabelPresenter}" x:Key="ButtonNextHeaderStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:LabelPresenter}"> <StackPanel Orientation="Horizontal"> <Label Content="BrandName"></Label> <Button Content=">>" Click="ButtonBase_OnClick" Width="20" Height="20"></Button> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
Thanks Zhivko.
it might be useful for me. but i just want to ask to regarding the xamdatagrid.
I want to scrollbar for the fields which are not fixed. I have grid which have more columns which are fixed and some 5-6 columns are not fixed.
I want scrollbar display for that two fields not for the whole grid. can you guide me to achieve this.
Hello,
Thank you for your post.
I have been looking into your requirement. What I can suggest is to handle the click event of the Button for each column. In the event handler you can get the name of the current Field and access it through the Fields collection of XamDataGrid. I modified the last sample application to show you how you can implement the functionality that you are looking for. Please let me know if I am missing something about your scenario.
If you require any further assistance, please do not hesitate to ask.
i want to reload the other column on the click event of button but i can't find the column in button click event.
can you please help me on this
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
Hello Ripal,
I have been looking into it and the image that you have provided. What I can suggest is to copy and paste the default style for LabelPresenter into the resources of the XamDataGrid. Then you can re-template it as add button to the header. This way you will keep all of the default functionality. You can find the default styles on your computer in the destination:
C:\Program Files (x86)\Infragistics\2014.2\WPF\DefaultStyles\DataPresenter
The file you need is named DataPresenterGeneric_Express.xaml. I created a short sample application based on your scenario to show you how you can implement the functionality that you want. In the sample a copied the style and re-template it as I added a button after the FixedFieldButton.
Please let me know if you need any further assistance on the matter.