Telerik Forums
UI for WPF Forum
3 answers
372 views
Hi,

In the custom hierarchy demo it shows how to show and hide the expand button during row loaded event. My question is if the users are able to add and remove child rows though the user interface after the gridview is loaded and I don't want to display the expand button if there are no child rows, is there a way to achieve it? 

Thanks.
Vanya Pavlova
Telerik team
 answered on 15 Aug 2011
1 answer
679 views
I'm trying to automatically select the crop tool when an image is loaded. All is ok if I preload the image, but if I allow the user to select the image, I can't seem to find the event that is called after I load up the image to load the tool.

It's probably right in front of me.

Thanks

-Matt
Iva Toteva
Telerik team
 answered on 15 Aug 2011
1 answer
207 views
Hi team,
           Actually my requirement is this. I have a set of resources bound to the RadScheduleView. I just want to change the mothview background color based on the resource and number of appointments booked for the day for the particular resource. If no of appointments is below 10 I want to change the monthviewitem background to green and if exceeds 10 it should be red in color. In
RadScheduler I used TimeSlotTemplateSelector to acheive this. I dont know how to do this in scheduleview. Any help....
This is the screenshot...
I marked the area where the background need to be changed...The empty slots are in brown. The slot which has less than 10 appointments are in green and more than 10 appointments are in Red.


Konstantina
Telerik team
 answered on 15 Aug 2011
1 answer
51 views
Hi,

Have just upgraded to 2011.2.712.35 and discovered that when I change the content for a grid view by assigning the ItemsSource value, it now collapses all expanded groups. Previously, it would remember which groups the user had expanded and expand them to look the same with the new data.

Is there anyway to configure the behaviour to be like the earlier versions or do I need to go back to 2011.1.419.0.

Best regards,

Russell
Vanya Pavlova
Telerik team
 answered on 15 Aug 2011
1 answer
245 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
151 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
104 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
166 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
160 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
128 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
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?