or
public
static
class
MultiSelect
{
static
MultiSelect()
{
Selector.ItemsSourceProperty.OverrideMetadata(
typeof
(Selector),
new
FrameworkPropertyMetadata(ItemsSourceChanged));
}
public
static
bool
GetIsEnabled(Selector target)
{
return
(
bool
)target.GetValue(IsEnabledProperty);
}
public
static
void
SetIsEnabled(Selector target,
bool
value)
{
target.SetValue(IsEnabledProperty, value);
}
public
static
readonly
DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached(
"IsEnabled"
,
typeof
(
bool
),
typeof
(MultiSelect),
new
UIPropertyMetadata(IsEnabledChanged));
static
void
IsEnabledChanged(
object
sender, DependencyPropertyChangedEventArgs e)
{
Selector selector = sender
as
Selector;
IMultiSelectCollectionView collectionView = selector.ItemsSource
as
IMultiSelectCollectionView;
if
(selector !=
null
&& collectionView !=
null
)
{
if
((
bool
)e.NewValue)
{
collectionView.AddControl(selector);
}
else
{
collectionView.RemoveControl(selector);
}
}
}
static
void
ItemsSourceChanged(
object
sender, DependencyPropertyChangedEventArgs e)
{
Selector selector = sender
as
Selector;
if
(GetIsEnabled(selector))
{
IMultiSelectCollectionView oldCollectionView = e.OldValue
as
IMultiSelectCollectionView;
IMultiSelectCollectionView newCollectionView = e.NewValue
as
IMultiSelectCollectionView;
if
(oldCollectionView !=
null
)
{
oldCollectionView.RemoveControl(selector);
}
if
(newCollectionView !=
null
)
{
newCollectionView.AddControl(selector);
}
}
}
}
StepAction="MoveRange" and range is moving with the mouse click.
But the issue is that when I a dragging mouse then range is changing. How do I disable the Mouse drag.
HorizontalAlignment="Right"
IsSnapToTickEnabled="True"
Margin="0,10,12,52"
Minimum="1"
Name="monthSlider"
Maximum="12"
SmallChange="0"
StepAction="MoveRange"
TickFrequency="1"
LargeChange="3"
SelectionEnd="3"
SelectionStart="1"
IsSelectionRangeEnabled="True"
SelectionRangeChanged="monthSlider_SelectionRangeChanged"
<telerik:RadWindow x:Name="windowDetalhesPrevisao" Header="Detalhes do Lançamento da Previsão" Grid.Row="3"> a simple grid with this options <telerik:RadWindow.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="35" /> <RowDefinition Height="25" /> <RowDefinition Height="25" /> <RowDefinition /> </Grid.RowDefinitions>
and other things ... stackpanel...
finally, a radgridview<telerik:RadGridView x:Name="GridDadosPrevisao" Grid.Row="3" HorizontalAlignment="Left" AutoGenerateColumns="True" IsReadOnly="True" FrozenColumnCount="2" ShowGroupPanel="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False" IsFilteringAllowed="False" Margin="5"> </telerik:RadGridView>
my problem is, this radgrid view dont create the scrollbar Horizontal first time,
but, when i close the window and open again, this radgridview create!
2 links with screenshot
first
http://img840.imageshack.us/i/24050593.jpg/
second
http://img850.imageshack.us/i/25696953.jpg/
see?
when i open the window, scrollbar dont be there and
the radgridview stay "CUT", incomplete.
when i close and open again, scrollbar be there, complete!
why?
what happens?
sorry for english
i am starter with english
i am from brazil!
thx guys!