Telerik Forums
UI for WPF Forum
1 answer
220 views
I have these two styles defines in separate resourcedictionary files in a separate project:

 <Style TargetType="ScrollViewer">
        <Setter Property="telerik:StyleManager.Theme"  Value="Windows7" />
    </Style>

    <Style x:Key="ListViewNoHighlightSelection"         TargetType="ListView">
        <Style.Resources>
            <!-- Background of selected item when focussed -->
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
            <!-- Background of selected item when not focussed -->
            <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
        </Style.Resources>
    </Style>

This is how I use this style:

 

  <ListView x:Name="advertFormatSelector"  Grid.Row="0"       Grid.Column="0"
                      Grid.ColumnSpan="7"
                      Margin="2,2"
                      BorderThickness="0"
                      ItemsSource="{Binding BasketItemTemplates}"
                      SelectedItem="{Binding SelectedBasketItemTemplate, Mode=TwoWay}"
                      MaxHeight="100"
                      >
                <ListView.Style>
                    <Style BasedOn="{StaticResource ListViewNoHighlightSelection}"
                           TargetType="{x:Type ListView}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=Dimensions}"
                                         Value="{x:Null}">
                                <Setter Property="BorderBrush"
                                        Value="{StaticResource ErrorBrush}" />
                                <Setter Property="BorderThickness"
                                        Value="2" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ListView.Style>
                <ListBox.ItemContainerStyle> .. </ListBoxItemContainerStyle>
    <ListView.ItemTemplate>...    </ListView.ItemTemplate>
            </ListView>

My problem is that the scrollviewer is displayed but it is non-functional (grayed out) since the listview has all the space it needs. I guess showing non-functional scrollbars are part of the theme, but I want no scrollbar when no scrolling is nessesary. I do not want that scrollviewer to be displayed. Adding:

        <Setter Property="VerticalScrollBarVisibility"  Value="Auto" />
        <Setter Property="HorizontalScrollBarVisibility"  Value="Auto" />
(or even setting the value to Disabled)

acheives nothing - I've tried to apply these lines to ListViewNoHighlightSelection, to my listview and to its style.

Why do the GUI behave like that and how do I make the scrollbar dissappear ?






Vanya Pavlova
Telerik team
 answered on 15 Aug 2011
1 answer
135 views
I'd like to use a DataTemplateSelector with the RadFluidContentControl.  While the RadFluidContentControl exposes SmallContentTemplate, LargeContentTemplate, and ContentTemplate properties, there seems to only be a ContentTemplateSelector property.  I'd like to be able to logically determine what template to use for the Large and Small states.  Do you have any recommendations?
Petar Mladenov
Telerik team
 answered on 15 Aug 2011
5 answers
98 views
Hi,

I noticed you have functionality to give 'helper arrows' to the user when dragging to reorder columns for ASP.NET (an up and down arrow to point to where the column will go), shown here:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/resizing/defaultcs.aspx

Is this type of behavior possible with the WPF version of the RadGridView control?

Thanks in advance,
Mark
Mark
Top achievements
Rank 1
 answered on 13 Aug 2011
0 answers
151 views
HI

I m new to Telerik WPF, i m having a problem with child binding, can u plz help me out.

code:
<telerik:RadGridView x:Name="AnalysisListGridView" Grid.Column="3" Grid.Row="2"  Width="665" Height="405" RowLoaded="RadGridView1_RowLoaded"
                                 AutoGenerateColumns="False" IsReadOnly="True" VerticalAlignment="Center" HorizontalContentAlignment="Left"
                                 MinColumnWidth="20" GridLinesVisibility="Horizontal" RowHeight="33" CanUserSortColumns="True" CanUserResizeColumns="False"
                                 CanUserReorderColumns="False" CanUserFreezeColumns="False" FontSize="12" ScrollViewer.CanContentScroll="true"
                                 FontFamily="Arial" Padding="0,0,0,0" BorderBrush="#FFCBD7E3" Foreground="#FF707070" Background="#FFFFFFFF"
                                 HorizontalGridLinesBrush="#FFEEEEEE" SelectionUnit="FullRow" SelectionMode="Single" ShowGroupPanel="False"
                                 RowIndicatorVisibility="Collapsed" GroupPanelForeground="Black" AlternateRowBackground="#FFF4F4F4" telerik:Theming.Theme="Windows7"
                                 telerik:StyleManager.Theme="Windows7" BorderThickness="1" Cursor="Hand" LoadingRowDetails="AnalysisListGridView_LoadingRowDetails">
                <telerik:RadGridView.HeaderRowStyle>
                    <Style TargetType="telerik:GridViewHeaderRow">
                        <Setter Property="Background">
                            <Setter.Value>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop Color="#FFcfd7db"/>
                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </telerik:RadGridView.HeaderRowStyle>
                <telerik:RadGridView.ChildTableDefinitions>
                    <telerik:GridViewTableDefinition/>
                </telerik:RadGridView.ChildTableDefinitions>
 
            </telerik:RadGridView>
private void GetHistoryInfo()
{
    this.AnalysisListGridView.ItemsSource = null;
    this.AnalysisListGridView.ItemsSource = ROISync.GetOfflineAnalysisHistory(App.LoggedInUser).ListROIAnalysis.OrderByDescending(an => an.AnalysisLastUpdatedDateTime);
}
 
void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e)
{
    GridViewTableDefinition definition = new GridViewTableDefinition();
    GridViewRow row = e.Row as GridViewRow;
    ROIAnalysisDataModel analysis = e.DataElement as ROIAnalysisDataModel;
 
    if (row != null && analysis != null)
    {
        row.IsExpandable = this.HasSubordinates(analysis);
    }
}
 
private bool HasSubordinates(ROIAnalysisDataModel analysis)
{
    IEnumerable<ROIAnalysisDataModel> childDataSource = ROISync.GetOfflineAnalysisHistory(App.LoggedInUser).ListROIAnalysis.Where(a => a.ParentID != 0).OrderByDescending(an => an.AnalysisLastUpdatedDateTime);
    return (from Anlys in childDataSource where Anlys.ParentID == analysis.AnalysisID select Anlys).Any();
}
 
void AnalysisListGridView_LoadingRowDetails(object sender, GridViewRowDetailsEventArgs e)
{
 
    GridViewTableDefinition definition = new GridViewTableDefinition();
    GridViewDataControl dataControl = (GridViewDataControl)sender;
    if (dataControl.ParentRow != null && dataControl.ChildTableDefinitions.Count == 0)
    {
        int ParentID = Convert.ToInt32(((ROIDataModels.ROIAnalysisDataModel)(((Telerik.Windows.Controls.RadRowItem)(dataControl.ParentRow)).Item)).AnalysisID);
        foreach (ROIDataModels.ROIAnalysisDataModel folder in ROISync.GetOfflineAnalysisHistory(App.LoggedInUser).ListROIAnalysis)
        {
            if (folder.FileType.ToLower() == "folder" || folder.ParentID == ParentID)
            {
                definition.DataSource = null;
                definition.DataSource = ROISync.GetOfflineAnalysisHistory(App.LoggedInUser).ListROIAnalysis.Where(a => a.ParentID == folder.ParentID).OrderByDescending(an => an.AnalysisLastUpdatedDateTime);
                dataControl.ChildTableDefinitions.Add(definition);
            }
        }
    }
}
 
private void AnalysisListGridView_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
{
    GridViewDataControl dataControl = (GridViewDataControl)sender;
    if (dataControl.ParentRow != null)
    {
        dataControl.ShowGroupPanel = false;
        dataControl.AutoGenerateColumns = false;
        dataControl.CanUserFreezeColumns = false;
        dataControl.IsReadOnly = true;
        dataControl.SelectionMode = System.Windows.Controls.SelectionMode.Extended;
        dataControl.IsFilteringAllowed = false;
        dataControl.ShowInsertRow = false;
        dataControl.RowIndicatorVisibility = Visibility.Collapsed;
        dataControl.ChildTableDefinitions.Clear();
        dataControl.Margin = new Thickness(0, 0, 0, 0);
        dataControl.EnableRowVirtualization = true;
        dataControl.MaxHeight = 100;
        ScrollViewer.SetVerticalScrollBarVisibility(dataControl, ScrollBarVisibility.Auto);
 
        int ParentID = Convert.ToInt32(((ROIDataModels.ROIAnalysisDataModel)(((Telerik.Windows.Controls.RadRowItem)(dataControl.ParentRow)).Item)).AnalysisID);
        GridViewTableDefinition definition = new GridViewTableDefinition();
        definition.DataSource = null;
        definition.DataSource = ROISync.GetOfflineAnalysisHistory(App.LoggedInUser).ListROIAnalysis.Where(a => a.ParentID == ParentID).OrderByDescending(an => an.AnalysisLastUpdatedDateTime);
        //dataControl.ChildTableDefinitions.Clear();
        dataControl.ChildTableDefinitions.Add(definition);
    }
}


note:
Is there any folder structure options available there in wpf,
screenshot attached is the mockup for Folder Structure.



Thanks
Zeno J S
Zeno
Top achievements
Rank 1
 asked on 13 Aug 2011
2 answers
147 views
I'm attempting to conform to the MVVM paradigm for my project. I'm already binding to a LocationCollection, which I use to plot points for a polygon on the map. This is working fine using the following:

<telerik:InformationLayer Name="informationLayer">
    <telerik:MapPolygon Points="{Binding MyPolygon}" />
</telerik:InformationLayer>


I'd like to add additional information in the form of images that are dragged and dropped onto the map. I have no problem manually adding images using the following in the code behind:

RadMap map = (RadMap)e.Options.Destination;
Location dropCursorLocation = Location.GetCoordinates(map, e.Options.RelativeDragPoint);
Image img = new Image { Source = new BitmapImage(new Uri(@"..\Resources\MyImage.png", UriKind.Relative)) };
 
MapLayer.SetLocation(img, dropCursorLocation);
informationLayer.Items.Add(img);

I'm fine with everything in the view model up until I add the image to the information layer. The MapPolygon typed works well for my polygon, but what should I use for my images? Should I add another type under the InformationLayer section? If so, which type should I use?
Sean
Top achievements
Rank 1
 answered on 12 Aug 2011
1 answer
112 views
The example in the documentation for Drag and Drop in RadTreeView indicates that setting IsDragDropEnabled="True" will allow elements to be dragged both into other elements and before/after said elements. However, in my experience I cannot get elements to successfully drag before/after other elements even with the very simple example code (pasted below). What am I missing?

        <telerik:RadTreeView x:Name="radTreeView" Grid.Row="2" IsDragDropEnabled="True" IsDropPreviewLineEnabled="True">
            <telerik:RadTreeViewItem Header="Sport Categories">
                <telerik:RadTreeViewItem Header="Football">
                    <telerik:RadTreeViewItem Header="Futsal"/>
                    <telerik:RadTreeViewItem Header="Soccer"/>
                </telerik:RadTreeViewItem>
                <telerik:RadTreeViewItem Header="Tennis">
                    <telerik:RadTreeViewItem Header="Table Tennis"/>
                </telerik:RadTreeViewItem>
                <telerik:RadTreeViewItem Header="Cycling">
                    <telerik:RadTreeViewItem Header="Road Cycling"/>
                    <telerik:RadTreeViewItem Header="Indoor Cycling"/>
                    <telerik:RadTreeViewItem Header="Mountain Bike"/>
                </telerik:RadTreeViewItem>
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>

Tina Stancheva
Telerik team
 answered on 12 Aug 2011
4 answers
330 views
I've got a form with a RadSplitButton on it.  I've set the control's DropDownContent to a RadContextMenu.  When I click on the DropDown indicator, the context menu shows.  However, when you click on an item in the context menu, the context menu does not close.

How do I make the context menu close once an item in the menu has been clicked?  There doesn't seem to be a Close method in the RadContextMenu class, though there are Closing & Closed events.

Also, is there a way that I can change the width of the Drop Down Indicator?  There doesn't seem to be a property for it.  I'm working on a WPF application with touch screen support that will run in a police car, so everything has to be large for a cop to make effective use while driving.  The buttons are rather large & the drop down indicator is down-right puny & easily missed at its current size.

Tony
Viktor Tsvetkov
Telerik team
 answered on 12 Aug 2011
2 answers
171 views
Hi,
when I am using an observable collection of the following class as ItemsSource for the datagrid I get an exception when  I add a new Row (via UI, ShowInsertRow is enabled) and the row is commited.

ArgumentOutOfRangeException: "Specified argument was out of the range of valid values. Parameter name: index".
Source: "Telerik.Windows.Data"
Stacktrace: "bei Telerik.Windows.Data.QueryableCollectionView.GetItemAt(Int32 index) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:Zeile 1766."
File Version of Telerik.Windows.Controls.GridView.dll is 2011.2.712.40.

This happens only when binding a list of ParameterView. ViewModelBase just implements INotifyPropertyChanged.
public class ParameterView : ViewModelBase<ParameterView>
{
    private string _name;
    public string Name
    {
        get { return _name; }
        set { _name = value; Notify(x => x.Name);}
    }
  
    private string _value;
    public string Value
    {
        get { return _value; }
        set { _value = value; Notify(x => x.Value); }
    }
  
    public ParameterView() : this(string.Empty,string.Empty)
    {
    }
  
    public ParameterView(string name, string value)
    {
        Name = name;
        Value = value;
    }
  
    public override string ToString()
    {
        return string.Format("Name: {0}, Value: {1}", _name, _value);
    }
  
    public bool Equals(ParameterView other)
    {
        if (ReferenceEquals(null, other)) return false;
        if (ReferenceEquals(this, other)) return true;
        return Equals(other._name, _name);
    }
  
    public override bool Equals(object obj)
    {
        if (ReferenceEquals(null, obj)) return false;
        if (ReferenceEquals(this, obj)) return true;
        if (obj.GetType() != typeof(ParameterView)) return false;
        return Equals((ParameterView)obj);
    }
  
    public override int GetHashCode()
    {
        unchecked
        {
            return ((_name != null ? _name.GetHashCode() : 0) * 397) ^ (_value != null ? _value.GetHashCode() : 0);
        }
    }
}
Sebastian
Top achievements
Rank 1
 answered on 12 Aug 2011
3 answers
48 views
Hi Support,

I am looking out for search option with suggestion. Please see the exmaple here  As for example if you type F in  the search box, it should suggest you all possible states and country starting with "F" .

Please provide some sample code.

Thanks for the help,
Vivek.
Andrey
Telerik team
 answered on 12 Aug 2011
1 answer
105 views
I have a tileview bound to a collection of custom objects.  I would like to make sure that the tileview scrolls to a given item based on a property of the underlying object.  Can you point me in the right direction?
Tina Stancheva
Telerik team
 answered on 12 Aug 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?