Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

RadGridView Flickers when ColumnWidth is set to Fill *

$
0
0

Hi,

 

 I am using RadDropDownButton and RadDropDownContent has a grid with a message and RadGridView.  RadGridview has a single column which has data template that render checkboxes for the elements in list to which this column is bound to.  I get an additional space / extra column at the end of the radgridview.  When I try to remove this column by setting width of the only property to * or set columnwidth of radgridview to * as suggested in the forums,  the grid just keeps on flickering.  I seem to be missing something very simple.  Any help on removing this extra space is appreciated..

 

XAML -

 

<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Title="MainWindow" Height="350" Width="525">
    
    <telerik:RadDropDownButton DropDownIndicatorVisibility="Collapsed" 
                                               Height="25"
                                               Width="25"
                                               ToolTip="Configure Column Set"
                                               Padding="0"  
                                               HorizontalContentAlignment="Left" 
                                               Margin="0,0,6,0"
                                               IsOpen="{Binding IsDropDownContentOpen, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                               Command="{Binding ConfigureColumnSetCommand}">

       
        <telerik:RadDropDownButton.DropDownContent>

            <Grid Margin="10">

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!-- Configure Column Set Text-->
                <TextBlock x:Name="txtConfigColumnSetMsg"
                                               Text="Select columns to be visible in grid" />


                <!-- Configure Column Set Grid -->
                <telerik:RadGridView x:Name="grdConfigureColumnSet"
                                                         ItemsSource="{Binding ColumnSet,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                                         Grid.Row="1"
                                                         ShowGroupPanel="False"
                                                         ShowInsertRow="False"
                                                         CanUserDeleteRows="False"
                                                         CanUserFreezeColumns="False"
                                                         RowIndicatorVisibility="Collapsed"
                                                         AutoGenerateColumns="False"
                                                         SelectionMode="Single"
                                                         AutomationProperties.AutomationId="grdConfigureColumnSet"
                                                         ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                                         ScrollViewer.IsDeferredScrollingEnabled="False"
                                                         ScrollViewer.CanContentScroll="False"
                                                         CanUserReorderColumns="False"
                                                         CanUserSortColumns="False"
                                                         CanUserSortGroups="False"
                                                         IsFilteringAllowed="False" >

                    <telerik:RadGridView.Columns>

                        <telerik:GridViewDataColumn  
                                                     IsReadOnly="True"
                                                     DataMemberBinding="{Binding IsSelected,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                     Width="*">

                           
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger= PropertyChanged}"
                                                                  Content="{Binding Name}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                        </telerik:GridViewDataColumn>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

               
            </Grid>
        </telerik:RadDropDownButton.DropDownContent>

    </telerik:RadDropDownButton>
</Window>

 

Code behind -

 Class MainWindow

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.DataContext = New MyViewModel
    End Sub

End Class

Public Class MyViewModel

    Public Sub New()

        ColumnSet.Add(New ColumnItem With {.Name = "Col1", .IsSelected = False})


    End Sub

    Public Property ColumnSet As New List(Of ColumnItem)

End Class

Public Class ColumnItem

    Public Property Name As String

    Public Property IsSelected As Boolean

End Class

 

 

 

Regards,

Sreeni.


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>