Hi,
how can i set left margin for cell value content in xamdatagrid??
Regards,
Jafar VM
Hi Rob,
thanks for ur post.that solved my issue.
Hi Jafar,
Do you still need assistance on this matter? If so can you provide the style you used for the CellValuePresenter?
Are you retemplating the CellValuePresenter? I see you are providing you're own CellValuePresenter style to the FieldSettings of the XamDataGrid. If you are retemplating the cell then that would explain why my style isn't working for you. Can you provide the style you used for CellValuePresenter?
i changed my xaml as u told.but its not setting margin. my grid xaml is as follows.
<igDP:XamDataGrid Name="NodeArtifactGrid" Controls1:XamDataGridExtensions.SortingCommand="{Binding Path=Commands.NodeArtifactGridSorting}" Grid.Row="1" Margin="5,10,5,2" VerticalAlignment="Top" FlowDirection="LeftToRight" ActiveDataItem="{Binding Model.SelectedHierarchicalNodeArtifact,Mode=TwoWay}" DataSource="{Binding Model.HierarchicalNodeArtifactsList,Mode=TwoWay}" ScrollingMode="Deferred" GroupByAreaLocation="None" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="LightGray" >
<igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="Margin" Value="50,1,1,1"/> </Style> </igDP:XamDataGrid.Resources>
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AllowDelete="False" DataRecordCellAreaStyle="{DynamicResource PCETReadOnlyDataRecordCellArea}" SelectionTypeRecord="Single" AutoGenerateFields="False" HighlightAlternateRecords="True" RecordSelectorLocation="None" AllowFieldMoving="No" RecordSelectorStyle="{DynamicResource PCET_XamDataGrid_RecordSelector}"></igDP:FieldLayoutSettings> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellValuePresenterStyle="{DynamicResource PCET_ProjectArtifactTextReadOnly_CellValuePresenter}" LabelTextAlignment="Left" AllowEdit="False" CellClickAction="SelectRecord" AutoSizeOptions="All" Width="Auto" AutoSizeScope="AllRecords"/> </igDP:XamDataGrid.FieldSettings>
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields>
<customField:CustomSortingField Name="FileName" Label="{tp:Localize fileName}" Visibility="Visible" Width="*"> <customField:CustomSortingField.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource LabelPresenterStyle}" > </igDP:FieldSettings> </customField:CustomSortingField.Settings> </customField:CustomSortingField> <customField:CustomSortingField CustomSortIndicatorVisibility ="Visible" IsScrollTipField="False" Name="Date" Label="{tp:Localize date}" Visibility="Visible" Width="*"> <customField:CustomSortingField.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource LabelPresenterStyle}" > </igDP:FieldSettings> </customField:CustomSortingField.Settings> </customField:CustomSortingField> <customField:CustomSortingField IsScrollTipField="False" Name="ArtifactSize" Label="{tp:Localize size}" Converter="{StaticResource FileConverter}" Visibility="Visible" Width="*"> <customField:CustomSortingField.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource LastColumn}" > </igDP:FieldSettings> </customField:CustomSortingField.Settings> </customField:CustomSortingField>
</igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
my custoem field class is
public class CustomSortingField : Field {
}
I'm not sure what you mean by it's not working for you. I've attached a sample that demonstrates how it changes the margin on cell values. When you run the sample you will see that the values in each cell have been shifted over to the right a considerable amount. Was this not what you were looking for?