Telerik Forums
UI for WPF Forum
0 answers
132 views
Hi Support Team,

I am facing an issue while dragging a row from source RadGridView which is in separate window (different instance of same application) and dropping it in target RadGridView which is in separate  window (different instnace of the same application). I have implemented like following but I am getting an exception which is following.  But if I drag text from textbox and drop into RadGridView instead of using GridRow as source it works fine. Please help is to resolve this issue.

"Error HRESULT E_FAIL has been returned from a call to a COM component."

App.xaml file contents are following:
=============================
<Application x:Class="DragAndDropWPFApp.App"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

 

xmlns:telerik=http://schemas.telerik.com/2008/xaml/presentation
StartupUri="MainWindow.xaml">

<Application.Resources>

<Style TargetType="telerik:GridViewRow">

<Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True"></Setter>

<Setter Property="telerik:RadDragAndDropManager.AutoDrag" Value="True"></Setter>

</Style>

</Application.Resources>

</Application>
====================================
I have two RadGridViews in the xaml windows which names are following:
1. rgvSource
2. rgvTarget

Code in the code behind file is following for DragOver Event.

private void rgvSource_DragOver(object sender, DragEventArgs e)
        {
            RadGridView grid = (RadGridView)sender;
            GridViewRow row = (GridViewRow)this.rgvSource.ItemContainerGenerator.ContainerFromItem(this.rgvSource.SelectedItem);
            User user = row.Item as User;
            string data = user.Id.ToString() + "," + user.UserName + "," + user.LastLoginDate.ToShortDateString();   
            DragDrop.DoDragDrop(rgvSource, data , DragDropEffects.Copy);

        }

Dropped Grid event is following

================================

 private void rgvTarget_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.Text))
                e.Effects = DragDropEffects.Copy;
            else
                e.Effects = DragDropEffects.None;  
        }

        private void rgvTarget_Drop(object sender, DragEventArgs e)
        {
            MessageBox.Show(e.Data.GetData(DataFormats.Text).ToString());
        }
=============================================================
so how to resolve Com expection?

Hope someone will help me out to resolve this issue. Its urgent.

Thanks

Laxman


 

 

 

 

 

Laxman
Top achievements
Rank 1
 asked on 13 Mar 2013
4 answers
264 views
I am trying to find an example of how to set a TabItem style if the Tab Control is bound so the tabitems are dynamically generated? I see examples when you explicitly set the style on the tabitem, but how do you do that on a bound tab control?

All I am trying to do is make it so the selected tab header is blue instead of the default color.
heavywoody
Top achievements
Rank 1
 answered on 12 Mar 2013
1 answer
317 views
Using Prism v4 (with MEF for that matter) + MVVM. There is a convenient way to let views/viewmodels be aware of the view's state. Simply implement the IActiveAware interface in the viewmodel (and/or the view) and make sure the view is attached to a region. Now, when the view becomes active/inactive the IsActive property of the viewmodel will reflect its state.

Now, I have something like 20 different panes but not all of them are visible at all times. Just like in Visual Studio, some documents need certain panes. E.g. if you open an image in Visual Studio, the Colors pane becomes visible. For commands and messages, this implies a problem. Again in Visual Studio, consider the Ins shortcut in the Image editor. Issuing this command adds a new image type. However, if you issue this command in your source code, you toggle insert mode. Ok, so a command can mean different things depending on context or "activeness" if you'd like. If the active document is an image, the command should be handled differently than if it is a text file.

So for my ImageViewModel I have an OpenCommand. The same goes for TextFileViewModel. Now, If I press the Ins key the active document's corresponding OpenCommand should be issued. If I had two views - ImageView and TextFileView - I would simply implement the IActiveAware interface and issue a DelegateCommand (which is IActiveAware) to make sure the right OpenCommand is triggered. But... I have my views in panes. Now what?

How can I successfully handle IActiveAware (or other suitable interface) for my RadDocking/RadDocumentPane/RadPane hierarchy?

E.g. When my active RadDocumentPane contains a TextFileView, then my TextFileViewModel should be aware of this "Text File state". Similarly, if my active RadDocumentPane contains a ImageView, then my ImageViewModel should be aware of this "Image File state".

This is needed not only to correctly coordinate commands, but also to allow multiple viewmodel instances know if they should respond to certain messages/events. Since panes can be pinned, hidden etc, it's not completely obvious how this should be handled. Ideas?

UPDATE: I believe a good start would be to let the setter of ActivePane issue the Microsoft.Practices.Prism.IActiveAware interface in the same way Prism does it. (See RegionActiveAwareBehavior.cs in Prism 4.)
Ivo
Telerik team
 answered on 12 Mar 2013
1 answer
107 views
Hello,

When I try to right click on a misspelled word in a RadRichTextBox, I am not getting any suggestions.  The Rad En-US dictionary is loaded for my project, and misspelled words are underlined in red.  I just do not get the dialog box with suggestions when I right click on the misspelled word.

Do you have any ideas as to why and how to fix the issue?

Thank you 
Vasil
Telerik team
 answered on 12 Mar 2013
3 answers
213 views

I have a RadGridView inside a RadPanelBarItem, the grid has lots of columns so doesn't fit horizontally in the PanelBarItem.  By default the RadPanelBarItem expands to accommodate the gird however I'd like the grid to respect the width of its parent RadPanelBarItem.

<telerik:RadPanelBar>
    <telerik:RadPanelBarItem IsExpanded="True">
        <telerik:RadPanelBarItem.Header>
            <TextBlock Text="Grid"/>
        </telerik:RadPanelBarItem.Header>
        <telerik:RadGridView >
            <telerik:RadGridView.Columns>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
                <telerik:GridViewColumn Header="Header">
                </telerik:GridViewColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </telerik:RadPanelBarItem>
</telerik:RadPanelBar>

I have tried binding the width of the RadGridView to the ActualWidth of the RadPanelBar which gets close but is off by a few pixels due to the margin around the RadPanelBarItem content.  I'd prefer a solution which doesn't involve binding the width of the grid.
Tina Stancheva
Telerik team
 answered on 12 Mar 2013
1 answer
242 views
I have an object hierarchy and for some of the classes I want to hide some properties for the propertygrid.

In the baseclass FieldProperty I have IsReadOnly, IsReadOnly is OK for a textbox but not for a label.

Let's sum it up

Label:
Don't show IsReadOnly 
TextBox:
Show IsReadOnly 

I use the intersection mode for displaying objects with common properties so I need AutoGeneratePropertyDefinitions="True" and I also need to create custom editors.

There are many more exceptions like this for all the other input types. I can't changes the object structure because the datalayer is already coded and there is not time to fix it.

Can someone help me?

Maya
Telerik team
 answered on 12 Mar 2013
3 answers
103 views
Hello folks,

we are using the version 2011.2.920.35 of the RadControls.
Our software is being used on windows xp, 7 and server 2008.

A dockpanel contains a ribbonbar (top) and the gridview. The gridview is filled with hundrets of items. When we maximize our window and use the scrollbar to scroll down to the last entry, some rows are displayed behind the taskbar. This happens only on vista, 7 and server 2008 (windows 8 not tested until  now). On windows xp all runs fine.

Please take a look at the bottom of the attached screenshots.

Is this a bug?


Kind regards




Gerardo
Top achievements
Rank 1
 answered on 12 Mar 2013
1 answer
74 views
Hi,

i'm using a radDataForm with an EditTemplate. There i have some "DataFormDataFields". I can change the
Foreground of the "Label", but how do i change the Foreground of the input-box?

See attached File (how to change color of the Word "Foreground"?).

Thanks
Regards
WW
Ivan Ivanov
Telerik team
 answered on 12 Mar 2013
1 answer
170 views
Good morning

I've been trying to insert a custom diagram shape into a RaddiagramContainer in code behind using the following 

containerItem.Items.Add(customshapeItem); 

it seems that the container.items.count is 1,however when the diagram is display shows my custom shape in the position of the diagram but not inside the container what could be happening?? 

Thanks in advanced
Tina Stancheva
Telerik team
 answered on 12 Mar 2013
1 answer
309 views
Hi There,

for more information please see the attachment.
I am creating a style for Dockpanel, for some part of control i want to remove the border and background, but i am unable to find the control part in the expression blend. 
can you please guide me that how i can remove unwanted properties from the style.

Regards,
Srinivas.
Masha
Telerik team
 answered on 12 Mar 2013
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?