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
300
XAMDATAGRID - Get value of Field
posted

When  XAMDATAGRID is loaded at that time we have applied below style…

  <Style x:Key="cvpGrayWithTick" TargetType="igDP:CellValuePresenter">

            <Setter Property="Background" Value="#FFF3F3F3"/>

            <Setter Property="BorderBrush" Value="Gray"/>

            <Setter Property="BorderThickness" Value="0,0,1,0"/>

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate TargetType="igDP:CellValuePresenter">

                        <Border Background="#FFF3F3F3" BorderBrush="Gray" BorderThickness="0,0,0.5,0" HorizontalAlignment="Stretch">

                            <Grid Background="Transparent" HorizontalAlignment="Stretch">

                                <ContentPresenter Margin="5,0,0,0" VerticalAlignment="Center"/>

                                <Image Visibility="Hidden" x:Name="imgTick" Source="..\Images\icons_tick.png" Stretch="Uniform" Width="12" Height="12" HorizontalAlignment="Right" VerticalAlignment="Center"  Margin="0,0,5,0"/>

                            </Grid>

                        </Border>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

Now…when user click on the button then I need to check all CELL of record(0)  and if cell contain value then we need to display image else image should be Invisbile.

How I can get value of filed.

this.grdMerge.Records[0].FieldLayout.Fields[5]…

??

  • 69686
    Verified Answer
    posted

    Hello,

    You need to cast the Record[0] record to DataRecord. The DataRecord itself exposes the Cells collection and from there you can iterate through the cells and check their values.


    Hope this helps.