This is a migrated thread and some comments may be shown as answers.

GridView Cell Template (Control disappear)

1 Answer 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Kamran asked on 02 Feb 2012, 12:31 PM
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>

1 Answer, 1 is accepted

Sort by
0
Humayon
Top achievements
Rank 1
answered on 27 Feb 2012, 03:55 AM
I have the same problem.
Tags
GridView
Asked by
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Humayon
Top achievements
Rank 1
Share this question
or