Telerik Forums
UI for WPF Forum
1 answer
114 views
I've ready through the migration guide, overview, and DragDropPayloadManager guides, but there is still not enough information to migrate my existing code.Even the migration guide isn't sure which event maps to which event (see attached photo).

Can someone familiar with making the migration help me port over this code since basically everything has changed?

        public void OnDragInfo(object sender, DragDropEventArgs e)
        {
            if (e.Options.Status == DragStatus.DropImpossible && DragCue != null)
            {
                DragCue.Background = DropImpossibleBackground;
                DropIndicator.Opacity = 0;
            }
            else if (DragCue != null)
            {
                DragCue.Background = DropPossibleBackground;

                DropIndicator.HorizontalOffset = e.Options.CurrentDragPoint.X - e.Options.RelativeDragPoint.X;
                DropIndicator.VerticalOffset = e.Options.CurrentDragPoint.Y - e.Options.RelativeDragPoint.Y + DropIndicator.Height;
                Debug.WriteLine(e.Options.CurrentDragPoint);
                DropIndicator.Opacity = 100;
            }
        }

        public void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            GridViewRow row = sender as GridViewRow;

            e.QueryResult = RadDragAndDropManager.GetAllowDrag(row) &&
                (e.Options.Destination == null || e.Options.Destination is GridViewRow);

            if ((e.QueryResult ?? false) && e.Options.Status == DragStatus.DragQuery)
            {
                e.Options.Payload = row?.DataContext;
            }
        }

        public void OnDropInfo(object sender, DragDropEventArgs e)
        {
            object item = e.Options.Payload;
            GridViewRow source = e.Options.Source as GridViewRow;
            GridViewRow destination = e.Options.Destination as GridViewRow;

            if (source != null && destination != null && AssociatedObject.Items.Contains(item) && e.Options.Status == DragStatus.DragComplete)
            {
                int index = AssociatedObject.ItemContainerGenerator.IndexFromContainer(destination);

                ((IList) AssociatedObject.ItemsSource).Remove(item);

                ((IList) AssociatedObject.ItemsSource).Insert(index, item);

                if (!ItemsSourceSupportNotifications)
                {
                    AssociatedObject.Rebind();
                }

                DropIndicator.IsOpen = false;
            }

            if (e.Options.Status == DragStatus.DragCancel)
            {
                DropIndicator.IsOpen = false;
            }
        }

        public void OnDropQuery(object sender, DragDropQueryEventArgs e)
        {
            GridViewRow targetRow = e.Options.Destination as GridViewRow;

            if (targetRow != null)
            {
                e.QueryResult = targetRow.GridViewDataControl == AssociatedObject;
            }
            else
            {
                e.QueryResult = false;
            }
        }
Dinko | Tech Support Engineer
Telerik team
 answered on 07 Feb 2019
5 answers
351 views

Hi All,

I am very new to Telerik, doing all my work through threads. The program I am working on it is already do have tables and so on, now I cannot find anyone with problem of sending email and sms.

I need to have a clue on how I can retrieve the particular fields on my clients table and send SMS notification. Email suppose to have an attachment field to attach the document slip.

All I would like to see is ViewModel and View binding data - just these 2, would really appreciate any short program as an example.

 

Regards,

Mncedi

 

Martin Ivanov
Telerik team
 answered on 07 Feb 2019
3 answers
209 views
My WPF application permits users to select from a collection of <UserControl/> at runtime.
Each <UserControl/> is loaded as content to a RadPane. Each RadPane, RadPaneGroup
and RadSplitContainer has a unique serialization tag:


internal void UserControlToRADPane(UserControl theControl, string theName)
{
    RadSplitContainer leftContainer = new RadSplitContainer() { InitialPosition = DockState.DockedLeft };
    RadPaneGroup group = new RadPaneGroup() { Name = "RPG" + (++_radPaneGroupId).ToString() };
    RadPane aPane = new RadPane() { Header = theName, Content = theControl };
 
    RadDocking.SetSerializationTag(leftContainer, "rsp_" + leftContainer.Name + "_tag" + (++_aStaticIntValue).ToString());
    RadDocking.SetSerializationTag(group, "rpg_" + group.Name + "_tag" + (++_aStaticIntValue).ToString());
    RadDocking.SetSerializationTag(aPane, "rp_" + aPane.Header + "_tag" + (++_aStaticIntValue).ToString());
 
    group.AddItem(aPane, DockPosition.Center);
    leftContainer.Items.Add(group);
    MainDockingManager01.Items.Add(leftContainer);
}


I have created an event handler for ElementSaving.  At the point we are saving a RadPane, I
want to serialize the contents (which is a user-selected <UserControl/> as above):


private void dockingManager01_ElementSaving(object sender, LayoutSerializationEventArgs args)
{
    // Since we are accessing UI elements, we need ownership and
    // the quickest way to get that is to run on the STA thread.
 
    if (args.AffectedElement.GetType() == typeof(Telerik.Windows.Controls.RadPane))
    {
        var uc = ((RadPane)args.AffectedElement).Content as UserControl;
        ViewModel.VMDockingManager01.Instance.ElementSaving(sender, args, uc);
    }
    else
        ViewModel.VMDockingManager01.Instance.ElementSaving(sender, args);
}

My first question: Am I on the right track with this approach, or has Telerik implemented
some functionality that would permit a cleaner approach?   I note a reference to a method
called GetPaneContent() at this link in the Silverlight forum.  Is that a reference to some
user-created method... or is it a method provided by Telerik?




Kalin
Telerik team
 answered on 06 Feb 2019
6 answers
110 views
A company that I consult for has an application that uses the expression editor.  A configuration box that uses the expression editor has a calculation that used to work but no longer does.  It appears that the Round function has changed to not allow parenthesis within it's own.  Can someone explain if there has been a recent change in R1 2019 that might explain this?
Ivan Petrov
Telerik team
 answered on 06 Feb 2019
8 answers
385 views

I'm binding a DataView to the ItemsSource of a RadGridView and some columns are of the DateTime type. On the DateTime-columns I set FilterMemberPath to col.DataMemberBinding.Path.Path + ".Date" as mentioned here: http://www.telerik.com/forums/filtering-on-date-only to only filter on the date part.

This functionality is now broken. I't works in 2016.1.217.45, but not in 2016.3.1024.45 or later versions (I've tried up to the latest release version 2017.2.216.40)

If I replace my DataView with an IEnumerable<SomeObject> the filtering works as expected.

Vladimir Stoyanov
Telerik team
 answered on 05 Feb 2019
7 answers
515 views

Hello,
I've been spiraling down a sad hole without any answers, so any insight is appreciated!

So I have a collection.  I'm not able to share my code for security reasons, but in the image provided, the data members which are NOT collections themselves are displayed in one radgridview above, while data members with corresponding collections are displayed in additional radgridviews below, as depicted in the image.  I am able to add an error icon onto the main radgridview with a custom message indicating that there is an "Error Below" using the "RowValidating" property of the radgridview.  The issue is that I am unable to remove the error icon from the parent radgridview if that row is not selected, since the the validation occurs on the row.  Once I select the row, the error is removed because the validation occurs.  

 

So I guess my question is, how can I force a validation on all rows?  This needs to happen after I call the Undo function.

 

Hope this was clear enough.

Regards,

Scooba

Vladimir Stoyanov
Telerik team
 answered on 05 Feb 2019
1 answer
151 views

Hello,

is there a way to apply a style to the integrated RadGridView of the MultiColumnComboBox ?

Regards,
Hans

Vera
Telerik team
 answered on 05 Feb 2019
6 answers
1.5K+ views
I have searched the forums and haven't seen anything that explains this.  In the WPF RadGridView Scrolling example the grid has a static header row.  I tried this example, but my header row scrolls.  Any guidance would be appreciated.

Thanks
Dinko | Tech Support Engineer
Telerik team
 answered on 05 Feb 2019
14 answers
719 views
Hello,
In the table I read from there are fields with values that are a few lines of string. After I load the table to the GridView, the GridView expands the rows' height so it could present all the data. I wanted to know how can I limit the rows' height in a way I'll see only the first row and the GridView won't expand. I've tried setting the "RowHeight" property of my GridView but it didn't do anything.

Thank you
Martin Ivanov
Telerik team
 answered on 05 Feb 2019
1 answer
66 views

Hi,

We are seeing an issue where setting the GroupRenderMode to "Flat" causes the nested row hierarchy details (inside a HierarchyChildTemplate) to disappearing after toggling the details. This problem goes away after setting the GroupRenderMode to "Nested".

 

Any ideas what might be causing this?

Dinko | Tech Support Engineer
Telerik team
 answered on 04 Feb 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?