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

Need your advice on this scenario. I have a ListBox where I drag my items from, to be dropped into a RadTileView. I am able to do a typical drag and drop action, where the dragged item is appended to the ItemsSource of the TileView. But I wish to implement the case where I can drop the item and insert it (instead of append) into the position I want. How do I go about doing this? Thanks for your time.

P.S. I'm not sure this should be posted here or the RadTileView forum. For now, I only posted here.
Ring Lee
Top achievements
Rank 1
 asked on 12 Jan 2012
1 answer
199 views
I'm extending a GridViewComboBoxColumn, setting IsComboBoxEditable to true, and trying to provide code to add typed text as items into the ItemsSource collection.

I hooked the CellEditEnded event of the GridView and added some test code to play with this idea:

private void TestGrid_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
{
    var comboBoxColumn = e.Cell.Column as Telerik.Windows.Controls.GridViewComboBoxColumn;
   
    // only continue if its a cell for the column we're interested in
    if ((comboBoxColumn == null) || (comboBoxColumn.UniqueName != "Lookup"))
        return;

    // get back the object used to represent the row
    var gridItem = e.Cell.DataContext as GridItem;
           
    // only continue if the text typed is not in the list
    if (gridItem.SelectedLookupItem != null)
        return;

    var cellComboBox = (RadComboBox)e.EditingElement;
    var lookupItemCollection = cellComboBox.ItemsSource as ObservableCollection<LookupItem>;

    var newItem = new LookupItem() { Name = cellComboBox.Text };
    lookupItemCollection.Add(newItem);

    //set the typed item as the selected item
    gridItem.SelectedLookupItem = newItem;
}

Works great. Now I want to move that code into my extended GridViewComboBoxColumn. How could I hook/override the CellEditEnded from inside the extended column?

Dimitrina
Telerik team
 answered on 12 Jan 2012
1 answer
63 views
I have two different collections with items of type A and B where B contains a child collection of type A and I'm displaying these two collections in two different RadGridViews and what I want to do is to be able to drag an item from one grid to the other so that I can add the appropriate item to the child collection (thus building a relationship between the two collections). I'm fairly new with WPF and just can't seem to see how to modify the examples to accomplish this DnD scenario. I'm guessing that I have to call the appropriate RadDragAndDropManager static methods for each row of the grid but as my grids are bound to my collection (via a View Model) I'm not sure how to do this or if it's the correct approach.

Any help/pointers would be greatly appreciated!

-Gary
Gary
Top achievements
Rank 1
 answered on 12 Jan 2012
2 answers
157 views
I'm sure there is some property I am missing, but I am having an issue on initial load of the grid.

Given the following code, if I expand the width of "Column 1" to the right, I never get the horizontal scrollbar visible to scroll to view the hidden columns.  This happens with EnableColumnVirtualization set to "True" as well.

<Window x:Class="WpfApplication1.GridWindow"
        Title="GridWindow" Height="300" Width="600">
    <Grid>
        <telerik:RadGridView EnableColumnVirtualization="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewColumn Header="Column 1" />
                <telerik:GridViewColumn Header="Column 2" />
                <telerik:GridViewColumn Header="Column 3" />
                <telerik:GridViewColumn Header="Column 4" />
                <telerik:GridViewColumn Header="Column 5" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>
Ievgen
Top achievements
Rank 1
 answered on 11 Jan 2012
0 answers
129 views
how to customize RadDataForm. means how to add manually textbox , combobox , datatime and etc control
and how to bind with database.
please give me example.
aavadesh
Top achievements
Rank 1
 asked on 11 Jan 2012
6 answers
163 views
Hi,

We are currently having issues running our application on Windows 7 tablet PC's. When the grid has data, we get a NullReferenceException. I found it that the exception will not occur when removing a specific column definition from the gridview:

  <telerik:GridViewColumn     CellTemplate="{StaticResource StatusButtons}"
                                            IsFilterable="False"
                                            MaxWidth="120"
                                            MinWidth="120"
                                            />

The application works fine on non-touch devices, but on touch devices (Win 7, .Net 3.5) the error occurs. Stopping the "Tablet PC Input" service does not help as mentioned in other threads.

The exception plus stacktrace

2012-01-09 10:09:18,868 FATAL - User Interface : Unhandled Exception
System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
   bij System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   bij System.Windows.ContextLayoutManager.fireAutomationEvents()
   bij System.Windows.ContextLayoutManager.UpdateLayout()
   bij System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   bij System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   bij System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   bij System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   bij System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)


The Xaml:
<UserControl x:Class="BrabantWater.UI.Screens.ZInspectionListScreen"
    xmlns:imageFactory="clr-namespace:Sap.Eam.UI.Theme;assembly=CustomTheme_WPF"
    Height="auto" Width="auto">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisConverter"/>
        <DataTemplate x:Key="StatusButtons">
            <StackPanel Orientation="Horizontal" Width="110">
                <telerik:RadButton Click="RadButtonDelete_Click" MinWidth="50"
                                   IsEnabled="{Binding Path=IsDeletable, Mode=OneWay}">
                    <Image Source="{Binding Path=DeleteImage, Mode=OneWay}" Width="32"/>
                </telerik:RadButton>
                <telerik:RadButton Click="RadButtonStatus_Click" MinWidth="50"
                                   IsEnabled="{Binding Path=IsEditable,Mode=OneWay}">
                    <Image Source="{Binding Path=StatusImage, Mode=OneWay}" Width="32"/>
                </telerik:RadButton>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="GridContainer">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,5" Height="35" HorizontalAlignment="Stretch" VerticalAlignment="Center">
            <telerik:RadButton x:Name="ButtonNewInstallation" Content="{lex:LocText Key=Inspection_New_Installation, Dict=InspectionResources, Assembly=Win32Resources}" MinWidth="100" Click="ButtonNewInstallation_Click"/>
            <telerik:RadButton x:Name="ButtonNewDamage" Content="{lex:LocText Key=Inspection_New_Defect, Dict=InspectionResources, Assembly=Win32Resources}" Margin="10,0,0,0" MinWidth="100" Click="ButtonNewDamage_Click"/>
        </StackPanel>
                     
        <telerik:RadGridView x:Name="InspectionGrid"
                             AlternationCount="2"
                             AutoGenerateColumns="False"
                             CanUserFreezeColumns="False"    
                             CanUserReorderColumns="False"
                             ColumnWidth="*"
                             EditTriggers="None"
                             Grid.Row="1"
                             Margin="5"
                             MouseDoubleClick="InspectionGrid_MouseDoubleClick"
                             RowIndicatorVisibility="Collapsed"
                             SelectionChanged="InspectionGrid_SelectionChanged"
                             SelectedItem="{Binding Path=CurrentInspection, Mode=TwoWay}"
                             ShowGroupPanel="false">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn UniqueName="DamageCodeDescription"
                                            Header="{lex:LocText Key=Inspection_Space, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=DamageCodeDescription, Mode=OneWay}"/>
                <telerik:GridViewDataColumn UniqueName="ItemCodeDescription"
                                            Header="{lex:LocText Key=Inspection_Part, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=ItemCodeDescription, Mode=OneWay}"/>
                <telerik:GridViewDataColumn UniqueName="ItemDescription"
                                            Header="{lex:LocText Key=Inspection_Addition, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=ItemDescription, Mode=OneWay}"/>
                <telerik:GridViewDataColumn UniqueName="CauseCodeDescription"
                                            Header="{lex:LocText Key=Inspection_Task, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=CauseCodeDescription, Mode=OneWay}" />
                <telerik:GridViewDataColumn UniqueName="TaskCodeDescription"
                                            Header="{lex:LocText Key=Inspection_Finding, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=TaskCodeDescription, Mode=OneWay}" />
                <telerik:GridViewDataColumn UniqueName="ActivityCodeDescription"
                                            Header="{lex:LocText Key=Inspection_Risk, Dict=InspectionResources, Assembly=Win32Resources}"
                                            DataMemberBinding="{Binding Path=ActivityCodeDescription, Mode=OneWay}" />
                <telerik:GridViewImageColumn DataMemberBinding="{Binding Path=AttachmentImage, Mode=OneWay}"
                                            Header="{lex:LocText Key=Inspection_Attachments, Dict=InspectionResources, Assembly=Win32Resources}"
                                            ImageHeight="32"
                                            ImageWidth="32"
                                            IsFilterable="False"
                                            MaxWidth="60"
                                            MinWidth="60"
                                            />
                <telerik:GridViewColumn     CellTemplate="{StaticResource StatusButtons}"
                                            IsFilterable="False"
                                            MaxWidth="120"
                                            MinWidth="120"
                                            />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>     
    </Grid>
</UserControl>

The version of the Telerik WPF components being used: 2010.2.0716.35.

How can we solve this issue?

Kind regards,

Mike
Martin
Top achievements
Rank 1
 answered on 11 Jan 2012
5 answers
121 views
Is there anyway to delay the execution of the query? What I'd like to do is create the datasource. Bind a DataFilter to it, then bind a gridview to the filtered source. But I'd like to not show any results in the gridview until the user has added filters. Basically use this as a searching mechanism.

Is this possible?

Also, are there any samples on how to use this in an MVVM scenario using QueryableEntityCollection<T> in the viewmodel?
Rossen Hristov
Telerik team
 answered on 11 Jan 2012
1 answer
229 views
i had an wpf application contains radtreeview ,i add HierarchicalDataTemplate inside RadTreeview Item Template which contains:

1- RadComboBox 
2- grid contains three textboxs and radcombobox.

when radcomobox selectionchanged the grid bind data into textboxes  according to the selected value in the combobox.

how i can return the current row when RadComboBox is changed, and how i get the contorls inside the row as well.

Regards 


Petar Mladenov
Telerik team
 answered on 11 Jan 2012
2 answers
229 views
I want to get the row in the data loaded event to set the focus on that row.
Vishwajeet
Top achievements
Rank 1
 answered on 11 Jan 2012
1 answer
114 views
Hi there

I'm grouping appointments on a day view by employees (EmployeeResource) so I see all the employee's appointments for the day on a column. Now, in the header template, I would like to show a total of hours already assigned (basically the sum of appointments durations.

The dirty version would be to provide such a total as a property of the EmployeeResource and update my resources on all edited/created/deleted events. However, I'm hoping there's a more elegant approach to this.

Thanks for your advice
Philipp
Yana
Telerik team
 answered on 11 Jan 2012
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?