GridView Cell Template (Control disappear)

2 posts, 0 answers
  1. Kamran
    Kamran avatar
    23 posts
    Member since:
    Nov 2011

    Posted 02 Feb 2012 Link to this post

    Hi Team,
    We are facing some problems with silverlight RadGridView's CellTemplate.
    1. Whenever we place a controll like RadMaskedCurrencyInput control in CellTemplate's DataTemplate, I face space between controls and layout problem as i mentioned in attached snapshots. If i try to stretch control horizontally according to the width of GridViewColumn, It doesn't cover the whole space.
    2. Second problem with this CellTemplate is Whenever i double click on the center of both two horizontal controls (i mean two column) , RadMaskedCurrencyInput disappears instinctively. 

    Following is code.
    Kindly Provide quick response

    <ns:GridView x:Name="gvAssets" Style="{StaticResource GridViewCommonStyle}" ShowColumnFooters="True" Grid.Column="0">
                <ns:GridView.Columns>
                    <ns:GridViewDataColumn Width="*" MinWidth="200" IsFilterable="False" Header="Asset Description">
                        <ns:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <ns:Label Name="lblAssetDesc" HorizontalAlignment="Left" Content="{Binding FINANCIALDETDESC}" />
                                    <ns:Label Name="lblAssetCode" HorizontalAlignment="Center" Content="{Binding FINANCIALDETID}" Visibility="Collapsed" />
                                </StackPanel>
                            </DataTemplate>
                        </ns:GridViewDataColumn.CellTemplate>
                        <ns:GridViewDataColumn.Footer>                      
                                <TextBlock Text="Total: "/>                      
                        </ns:GridViewDataColumn.Footer>
                    </ns:GridViewDataColumn>
                    <ns:GridViewDataColumn Width="0.3*" MinWidth="200" IsFilterable="False" FooterTextAlignment="Right" IsReadOnly="False" Header="Value">
                    <ns:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <ns:CurrencyTextBox Name="txtAssetValue" KeyDown="txtAssetValue_KeyDown" KeyUp="txtAssetValue_KeyUp" HorizontalAlignment="Stretch" IsEnabled="True" IsReadOnly="False" />
                            </DataTemplate>
                        </ns:GridViewDataColumn.CellTemplate>                                   
                        <ns:GridViewDataColumn.Footer>
                            <TextBlock Loaded="TextBlock_Loaded" Text="0.00" />                                                                  
                        </ns:GridViewDataColumn.Footer>
                    </ns:GridViewDataColumn>                         
                </ns:GridView.Columns>       
            </ns:GridView>
  2. Humayon
    Humayon  avatar
    12 posts
    Member since:
    Oct 2006

    Posted 26 Feb 2012 Link to this post

    I have the same problem.
Back to Top