Telerik Forums
UI for WPF Forum
1 answer
113 views
Hi all,
I would like to use the RadTileView to present a collection of TileViewItems in a grid layout.
Rather than specifying the widths and heights of the items, I'd like to be able to assign them to a row and column as is done with the standard Grid control.
I know this can be accomplished by replacing the RadTileView.ItemsPanel template however doing so completely breaks all of the drag and drop functionality.
I would create a sub-class of the RadTileView control however all of the drag and drop functionality is private.
Any suggestions on how to do this while preserving the drag and drop functionality would be greatly appreciated.

Thanks.
Pavel R. Pavlov
Telerik team
 answered on 09 Dec 2014
3 answers
179 views
Hi,

I used some code from the Demo, the radpanel with shapes.
When i drag and drop a shape on the diagram and call save, the last added shape is not saved, although it is present in the Items collection of the diagram.
What is the fix for this?
What is missing?

Best Regards
Zarko
Telerik team
 answered on 09 Dec 2014
3 answers
137 views
Hi.

I have a drag drop setup between a RadListBoxA (type A objects) and  a ScheduleView(Appointments)

I use OnDragInitialize on the ListBox like this:
private void OnDragInitialize(object sender, DragInitializeEventArgs args)
        {
            var leg = ((sender as ContentControl).Content as TransportOrderLegViewModel);
 
            
            // Convert Data to ScheduleView Payload
            var appt = new Appointment() {  };
            if (leg.Planned)
            {
                appt.Location = "Test";
            }
 
            var payload = new ScheduleViewDragDropPayload(null, new List<IOccurrence>() { appt });
 
            args.Data = payload;
 
 
            // Create DragVisual
            var cc = new ContentControl();
            cc.ContentTemplate = Resources.MergedDictionaries[2]["TOLDragVisualTemplate"] as DataTemplate;
            cc.Content = leg;
            args.DragVisual = cc;
            args.AllowedEffects = DragDropEffects.All;
 
            args.DragVisualOffset = args.RelativeStartPoint;
            args.Handled = true;
        }
In the schedule view I use ScheduleViewLevel1DragDropBehavior : ScheduleViewDragDropBehavior.
In the public override bool CanDrop(DragDropState state) the state.DraggedAppointments shows the appointments , so it all works. 

I will point out here that DragDropState is in fact for this converter an Telerik.Windows.Controls.DragDropState.

THE PROBLEM

Now I have to enable that the objects from RadListBoxA( Type A ) can also be dropped in another RadListBoxB (type B)

RadListBoxB already has dragging enabled from other sources , so it uses a SchematicViewListBoxDragDropBehavior : ListBoxDragDropBehavior
What I noticed is that in the override of CanDrop(DragDropState state) , DragDropState type comes from another namespace: Telerik.Windows.DragDrop.Behaviors.DragDropState

Whenever I drag something from RadListBoxA to RadListBoxB the state.DraggedItems has no elements. 

I thought of using the payload.SetData on the ScheduleViewDragDropPayload to attach extra data , but it doesn't implement that , as it seems it's a different kind of payload than the ones used in other documentation , for example this:
var payload = DragDropPayloadManager.GeneratePayload(null);
var data = ((FrameworkElement)args.OriginalSource).DataContext;
payload.SetData("DragData", data);
args.Data = payload;


Any suggestions would be much welcome. I'm hoping there is a way of doing it without having to rewrite the whole DragAndDrop between all the other controls that are already working nicely.

Thank you
Andrei
Top achievements
Rank 1
Iron
 answered on 09 Dec 2014
3 answers
165 views
Hi there,

I'm developing a view for a model which makes use of DataAnnotation validation. The RadGridView is automatically showing the error messages triggered by invalid input. But, the model's validators are returning a custom implementation derived from System.ComponentModel.DataAnnotations.ValidationResult which contains additional properties. I need to somehow bind those additional properties in the view (e.g. in the GridViewEditorPresenter) but it seems like the RadGridView is transforming the ValidationResult to some Telerik specific class (GridViewCellValidationResult) and of course the additional information gets lost. Is there an easy way (or maybe a work-around) to somehow access the original ValidationResult in the GridViewCellValidationResult-Template?

Regards,
Marcel

Maya
Telerik team
 answered on 09 Dec 2014
5 answers
140 views
I am using the mind map of telerik.

I want to add this functionality in the node. The ability that when a node is double clicked it selects all the text in the node and allows the user to start typing and have it replace the text. This will replace the current functionality of having to double click on a node then clicking the textbox to be able to change the text. 
Martin Ivanov
Telerik team
 answered on 09 Dec 2014
1 answer
245 views
I have a grid with:
CanUserSelect="True"
RowDetailsVIsibilityMode="VisibleWhenSelected"

My RowDetailsTemplate has a StackPanel with the Visibility set using a converter as so:

<telerik:RadGridView.RowDetailsTemplate  >
            <DataTemplate >
                              <StackPanel Orientation="Horizontal" Visibility="{Binding myVariable, Converter={StaticResource IsShownConverter}}" >


The converter is filtering properly, and only about 10% of my rows show something in the details template when selected.
The other 90% of rows when selected open a blank area underneath the row.
That is ok, but not aesthetically pleasing.

How would I use the converter (or some other method?), to only allow the selection and showing of rowdetails for rows where the converter conditions are met?

Thanks.







Yoan
Telerik team
 answered on 09 Dec 2014
4 answers
208 views
Hi,

I am using a RadGridView inside of a UserControl with dynamic content (with MVVM).
The filtering mode of the Grid is set to 'FilterRow'.

Is it possible to remove validation from the TextBoxes of the filterrow?

We would like to use mathematical operators inside the TextBoxes to filter the DataGrid.
Example: If You type '>3' into the column filter of an 'AGE' column ('AGE' is of type 'int') I would like to perform in code behind the 'isGreaterThan' filter method.
The filtering in code behind won't be a problem, but the validation for this column is not accepting '>' because it is not a numeric value.

Can you provide an approach/code samples how to do this?

Thanks in advance
Heiko
ITC
Top achievements
Rank 1
 answered on 09 Dec 2014
1 answer
78 views
I'm having a fair bit of trouble trying to get a binding to work between a Data Access Fluent mapped class using the FetchPlans approach.

I had a previously working RadDataGrid working based on an ObservableCollection, which I manually populated, as you would expect. Now I'm converting the app over to Data Access and I'm stumbling. I have the following code that creates the Fetch Strategy and if I look at the log it does generate the output I would expect from the foreach loops.

Telerik.OpenAccess.FetchOptimization.FetchStrategy fetchStrategy = new Telerik.OpenAccess.FetchOptimization.FetchStrategy();
fetchStrategy.LoadWith<SessionData>(ses => ses.sesAPISource);
fetchStrategy.LoadWith<LapData>(lap => lap.mapSessionIdLap);
fetchStrategy.LoadWith<TelemetryData>(tel => tel.mapLapIdTelemetry);
 
simData.sessionQueryable = from c in simData.fluentModelContext.fluentSessions
        where c.sesAPISource == "MEMAPI"
        select c;
 
//test the iteration through the dataset
foreach (SessionData thesessions in simData.sessionQueryable)
{
    logger.Trace("Session: " + thesessions.sesTime);
    foreach (LapData thelaps in thesessions.sesLapData)
    {
        logger.Trace("Lap: " + thelaps.ltLapNumber);
        int i = 0;
        foreach (TelemetryData thetel in thelaps.ltTelemetryData)
        {
            i++;
            logger.Trace("Tel: " + thetel.telCurrentTime);
            if (i > 20)
                break; //there is a lot of them
            }
        }
}

Previously I had a datasource binding set to {Binding simData.sessionsList} and an itemssource to {Binding}, which worked fine. When I tried accessing the data directly with this: "simData.fluentModelContext.fluentSessions.ToList();" and bound the datasource to {Binding simData.fluentModelContext} and the itemssource to {Binding fluentSessions} that also worked, although the associations didn't, as you may expect.

But I can't seem to get the bindings correct to work with the queryable, which I have declared like this:

private IQueryable<SessionData> sessionqueryable;
public IQueryable<SessionData> sessionQueryable
{
    get { return sessionqueryable; }
    set { if (sessionqueryable == value) return; SetProperty(ref sessionqueryable, value); }
}

I'm fairly sure I've tried all kinds of datasource and itemssource binding combinations, but I just cannot figure out where I've gone wrong. I've tried for about 4 hours or so now and I've just stumped.

Does anyone have any idea of where I've strayed off the path?
Dimitrina
Telerik team
 answered on 09 Dec 2014
3 answers
75 views
On Right Click of the Cluster I would like to get the List of all the Children inside that ClusterItem , SO that I can Display the List in the Context Menu . 


Below is my cluster Code. Could anyone please help me in this




 <telerik:InformationLayer x:Name="InformationLayer" ClusteredDataSource="{StaticResource ClusteredDataSource}"></telerik:InformationLayer>


  <DataTemplate x:Key="ClusterTemplate" x:Name="DataTemplate">
            <Grid x:Name="ParentRoot"     Width="40" Height="40" telerik:MapLayer.Location="{Binding Path=Center}" telerik:MapLayer.HotSpot="0.5,1"
 MouseRightButtonUp="MapMouseRightButtonUp" Tag="{Binding Path=Data}" >
                <Path Data="" Stretch="Fill" Margin="0,0,-0.574,0" StrokeThickness="0.2">
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="Green"  Offset="0"/>
                            <GradientStop Color="Green" Offset="1"/>
                            <GradientStop Color="Green"  Offset="0.523"/>
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
                <!-- Title -->
                <StackPanel x:Name="Text" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <TextBlock  FontSize="13" FontWeight="Bold"
                               Foreground="White"
                               Text="{Binding Path=Count}"/>
                </StackPanel>

            </Grid>
 </DataTemplate>

        <local:MassiveDataSource x:Key="MassiveDataSource" />
        <local:Test x:Key="Test"/>

            <telerik:ClusteredDataSource x:Key="ClusteredDataSource"
                 ItemsSource="{StaticResource MassiveDataSource}" ItemTemplate="{StaticResource ClusteredItemTemplate}"
                ClusterItemTemplate="{StaticResource ClusterTemplate}"   
                GenerateClustersOnZoom="True">

        </telerik:ClusteredDataSource>
vinutha
Top achievements
Rank 1
 answered on 09 Dec 2014
1 answer
118 views
var workbook = CreateWorkBook(grid, settings);
 
                     if (workbook != null)
                     {
                         var provider = new XlsxFormatProvider();
                         using (var output = dialog.OpenFile())
                         {
                             provider.Export(workbook, output);
                             fileName = dialog.FileName;
                         }
                     }

I use your demo for my project. But some time I get Error : the writer is closed or in error state.
Any Idea about this error.
It happen  in line: provider.Export(workbook, output);
Thanks
Petya
Telerik team
 answered on 08 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?