Telerik Forums
UI for WPF Forum
1 answer
83 views
Hi,

I need to export the data from radgridview into different format. such as excel, csv, and pdf. Is there a built-in utility to do this? looking at the doc, there is nothing metioning about exporting the data. please help?

thanks
Vlad
Telerik team
 answered on 20 Jan 2011
3 answers
192 views
Hi there,

I am trying to get drag and drop within a radtreeview to work for the following scenario without much luck after following a recent example posted in this forum.
* Two level hierarchy: A list of Teams containing Player objects.
* Teams and Players can be dragged.
* Teams can only be dropped before or after Team objects
* Players can be dropped inside a Team
* Players can be rearranged within a Team
* Players cannot be dropped inside of other Players

I managed to get some of the above working, however an issue I ran into is this. I could not stop a Player being placed at the same level as a Team object, when that Player is dragged right at the bottom of the treeview.

How do I prevent Player objects from being dragged to the root level?

This is what I have:
private void OnDropInsideTreeViewDropQuery(object sender, DragDropQueryEventArgs e)
{
  var destination = e.Options.Destination as RadTreeViewItem;
  if (destination != null && e.Options.Status == DragStatus.DropDestinationQuery)
    if (destination.DropPosition == DropPosition.Inside)
    {
      Console.WriteLine("Inside");
      Team t= destination.Item as Team;
      if (t != null)
      {
        object item = (e.Options.Payload as Collection<Object>)[0];
        if (item.GetType().Name == "Team")
        {
          e.QueryResult = false;
        }
      }
    }
    else
    {
      object item = (e.Options.Payload as Collection<Object>)[0];
      Team t = destination.Item as Team;
      if (t!= null)
      {
        if (item.GetType().Name == "Player")
        {
          e.QueryResult = false;
        }
      }
      else
      {
        //
      }

  • How can I prevent the Player being dragged to the same level as the Team objects?
David
Top achievements
Rank 1
 answered on 20 Jan 2011
5 answers
372 views
Hi,

We're using RadDropDownButton with a ContextMenu within a Grid:

    <telerik:RadGridView  
        RowIndicatorVisibility="Collapsed" 
        AutoGenerateColumns="False" 
        ShowGroupPanel="False"  
        RowDetailsVisibilityMode="VisibleWhenSelected" 
        Name="MainGrid" 
        ItemsSource="{Binding Alerts}" 
        ShowColumnHeaders="True" 
        ColumnWidth="*" 
        ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
    > 
        <telerik:RadGridView.Columns> 
            <telerik:GridViewDataColumn  
            Name="Severity"  
            EditTriggers="None" 
            Width="30"
                <telerik:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <StackPanel> 
                            <Image Source="{StaticResource CriticalAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsCriticalSeverity, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Critical Alert" 
                                   /> 
                            <Image Source="{StaticResource HighAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsErrorSeverity, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Error Alert" 
                                   /> 
                            <Image Source="{StaticResource MediumAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsWarningSeverity, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Warning Alert" 
                                   /> 
                            <Image Source="{StaticResource LowAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsInformationSeverity, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Informative Alert" 
                                   /> 
                            <Image Source="{StaticResource AutoremediationFailureAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsAutoremediationFailed, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Autoremediation has failed" 
                                   /> 
                            <Image Source="{StaticResource AutoremediationSuccessfulAlertIcon}"  
                               Style="{StaticResource IconImage}" 
                               Visibility="{Binding IsAutoremediationSuccessful, Converter={StaticResource VisibilityConverter_Collapsed}}" 
                               ToolTip="Autoremediation has succeeded" 
                                   /> 
                        </StackPanel> 
                    </DataTemplate> 
                </telerik:GridViewDataColumn.CellTemplate> 
            </telerik:GridViewDataColumn> 
            <telerik:GridViewDataColumn Name="Id"  
                                    Header="Id" 
                                    EditTriggers="None" 
                                    MaxWidth="50"
                <telerik:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <TextBlock 
                        Text="{Binding AlertId, Mode=OneWay}" 
                        TextWrapping="Wrap"/> 
                    </DataTemplate> 
                </telerik:GridViewDataColumn.CellTemplate> 
            </telerik:GridViewDataColumn> 
            <telerik:GridViewDataColumn Name="Device"  
                                    Header="Device Name" 
                                    EditTriggers="None" 
                                    MaxWidth="150" 
                                    TextWrapping="Wrap"
                <telerik:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <!-- We don't want the control to wrap --> 
                        <ContentControl 
                        DataContext="{Binding AssociatedViewModel, Mode=OneWay}" 
                        Content="{Binding}" 
                        ToolTip="{Binding Name}" 
                        Width="1000" 
                        /> 
                    </DataTemplate> 
                </telerik:GridViewDataColumn.CellTemplate> 
            </telerik:GridViewDataColumn> 
            <telerik:GridViewDataColumn Name="Headline" 
                                    Header="Alert Headline" 
                                    EditTriggers="None" 
                                    MaxWidth="9999"
                <telerik:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <StackPanel Orientation="Horizontal" Width="1500"
                            <TextBlock Text="WAITING FOR UPDATE: " FontWeight="Bold" 
                                       Visibility="{Binding IsWaitingForUpdate, Converter={StaticResource VisibilityConverter_Collapsed}}" /> 
                            <TextBlock Text="RESOLVED: "  
                                       Visibility="{Binding IsResolved, Converter={StaticResource VisibilityConverter_Collapsed}}" /> 
                            <common:IntelligentTextBlock  
                                DataContext="{Binding Headline, Mode=OneWay}" 
                                Width="1500" 
                                ToolTip="{Binding}" 
                                BubbleMouseEvents="True" 
                                /> 
                        </StackPanel> 
                    </DataTemplate> 
                </telerik:GridViewDataColumn.CellTemplate> 
            </telerik:GridViewDataColumn> 
            <telerik:GridViewDataColumn Name="LastUpdate"  
                                    Header="Last Update" 
                                    EditTriggers="None" 
                                    Width="140" 
                                    DataMemberBinding="{Binding LastUpdateDate,Mode=OneWay}" /> 
            <telerik:GridViewDataColumn Name="Resolve" 
                                    Header="Resolve" 
                                    EditTriggers="None" 
                                    Width="100"
                <telerik:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <telerik:RadDropDownButton  
                            Name="ResolveButton" 
                            HorizontalContentAlignment="Center" 
                            VerticalContentAlignment="Center" 
                            Content="Resolve" 
                            Padding="3" 
                            Height="25" 
                            Unloaded="ResolveButton_Unloaded" 
                            > 
                            <telerik:RadDropDownButton.DropDownContent> 
                                <telerik:RadContextMenu StaysOpen="False"
                                    <telerik:RadMenuItem Header="Sample Item"   
                                        ToolTip="Does something" 
                                        Command="{Binding DoCommand}"  
                                        StaysOpenOnClick="False" /> 
                                    <!-- More RadMenuItems... --> 
                                </telerik:RadContextMenu> 
                            </telerik:RadDropDownButton.DropDownContent> 
                        </telerik:RadDropDownButton> 
                    </DataTemplate> 
                </telerik:GridViewDataColumn.CellTemplate> 
            </telerik:GridViewDataColumn> 
        </telerik:RadGridView.Columns> 
        <telerik:RadGridView.RowDetailsTemplate> 
            <DataTemplate> 
                <Grid DataContext="{Binding}"
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="80"  /> 
                        <!-- The width of the Severity and ID columns --> 
                        <ColumnDefinition Width="*" /> 
                    </Grid.ColumnDefinitions> 
 
                    <!-- Darken the left margin: --> 
                    <Grid Background="Black" Opacity="0.4" /> 
 
                    <!-- The actual text --> 
                    <common:IntelligentTextBlock  
                        Grid.Column="1" 
                        DataContext="{Binding Description, Mode=OneWay}"  
                        /> 
                </Grid> 
            </DataTemplate> 
        </telerik:RadGridView.RowDetailsTemplate> 
    </telerik:RadGridView> 
 

The ContextMenu has many RadMenuItems, some of them with sub RadMenuItems as well. All of the items have commands. All items but one open a new Pane in the DocumentHost or open a new window. When these items are clicked, the context menu closes as it should.

The problem: One item, the first in the list, does not cause the context menu to close when clicked. This item does not open a new window, nor does it open a new pane. As part of our debugging we've actually set an empty command for this menuitem to see if the command was causing any issues. It didn't help. The command is called, but the context menu is not closing. We can close it by clicking elsewhere in the view.

We're using 2010 Q1 SP1, but this happens on 2010 Q1 as well.

We've tried doing things like hooking the Click even for the menu item and then setting the IsOpen property of the context menu to False, but it didn't help.

Any pointers?

Thanks,
yonadav

Scott Shuppert
Top achievements
Rank 1
 answered on 20 Jan 2011
3 answers
233 views
Hi,

I have a problem with map initialization. Simple solution only creates a Bing provider and sets it to RadMap in window loaded event. When I run the solution, after the window is shown, it freezes for couple of seconds while it is not able to respond to user events (actually the time the window is frozen differs every time the solution is ran).

I presume the lag is caused by map engine being initialized. The question is, why is this happening in UI dispatcher thread? Is there a way how to initialize the map without the UI freeze completely?

Thanks for any help.

Best Regards,
Michal.
Andrey
Telerik team
 answered on 19 Jan 2011
3 answers
118 views
Hi,
I need a all rows of dataGrid tobe selected by default.
How we can achive this.

 

 

 

<telerik:GridViewSelectColumn Header="Select" x:Name="chkbox" />

 


Maya
Telerik team
 answered on 19 Jan 2011
1 answer
98 views
Is it possible to have the RadDataFilter be a drop target?  In particular, I'd like to be able to drop onto the Members Dropdown.
Rossen Hristov
Telerik team
 answered on 19 Jan 2011
1 answer
189 views
Hi,
I have a RadWindow and I always want the rad window to have a horizontal scroll bar but, it is never displayed and I don't know why. Any Help would be great?


Thanks

Simon
<my1:RadWindow Name="PatientAlertWindow" BorderThickness="1" Background="#FF388CE3" BorderBackground="White" Foreground="Black" WindowStartupLocation="CenterOwner"  Width="570" Height="450" Closed="PatientAlertWindow_Closed" HorizontalAlignment="Left" Margin="0,0,0,227" VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" Header="Patient Alert" GotFocus="PatientAlertWindow_GotFocus">
                <Grid Background="#FF388CE3" SelectiveScrollingGrid.SelectiveScrollingOrientation="Both" ScrollViewer.HorizontalScrollBarVisibility="Visible" MinWidth="500">
                    <Grid.ColumnDefinitions>
  
                        <ColumnDefinition />
                        <ColumnDefinition />
  
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
                   <DataGrid AutoGenerateColumns="True" Name="PatientGrid" ItemsSource="{Binding}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" MinWidth="500" MinHeight="450" IsReadOnly="True" ScrollViewer.HorizontalScrollBarVisibility="Auto"/>
                </Grid>
            </my1:RadWindow>
Hristo
Telerik team
 answered on 19 Jan 2011
4 answers
382 views
When altering the celltemplate on a GridViewDataColumn, I do not get the expected values in GridViewCellValidatatingEventArgs in the CellValidating event.

My XAML looks like something this:

    <telerik:RadGridView Name="dayDriveLogGridView"
                             ItemsSource="{Binding DriveLog}"
                             AutoGenerateColumns="False"
                             Deleting="dayDriveLogGridView_Deleting"    
                             CellValidating="dayDriveLogGridView_CellValidating"
                             >

            <telerik:RadGridView.Columns>

   <telerik:GridViewDataColumn Name="colKilometers"
                                SortingState="Ascending"
                                DataMemberBinding="{Binding Path=Entity.Kilometers}"
                                CellStyle="{StaticResource DisableIfNotSettled}"
                       >
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="{localView:Translate Kilometers}" ToolTip="{localView:Translate DriveLogTooltip}" />
                    </telerik:GridViewDataColumn.Header>
                </telerik:GridViewDataColumn>

    <telerik:GridViewDataColumn Name="colDestination"
                                       IsReadOnly="False"
                                       DataMemberBinding="{Binding Entity.Destination, Mode=TwoWay}"
                                       CellStyle="{StaticResource DisableIfNotSettled}"
                                       >
               <telerik:GridViewDataColumn.Header>
                   <TextBlock Text="{localView:Translate Destination}" ToolTip="{localView:Translate DriveLogTooltip}" />
               </telerik:GridViewDataColumn.Header>
               <telerik:GridViewDataColumn.CellEditTemplate>
                   <DataTemplate>
                       <ComboBox x:Name="destinationComboBox" ItemsSource="{Binding Path=PossibleDestinations}" IsEditable="True"
                                 LostFocus="DestinationComboBox_LostFocus"
                                 SelectedItem="{Binding Path=Entity.Destination,
                                           Mode=TwoWay}"
                                 >
                           <ComboBox.Text>
                               <Binding Path="Entity.Destination" Mode="TwoWay"
                                        >
                                   <Binding.ValidationRules>
                                       <model:DestinationValidationRule ValidatesOnTargetUpdated="True" />
                                   </Binding.ValidationRules>
                               </Binding>
                           </ComboBox.Text>                                
                       </ComboBox>
                   </DataTemplate>
               </telerik:GridViewDataColumn.CellEditTemplate>
           </telerik:GridViewDataColumn>

       </telerik:RadGridView.Columns>
        </telerik:RadGridView>

Question 1: In dayDriveLogGridView_CellValidating, I get the expected e.NewValue when changing Kilometers, but not when changing Destination (whenever I input any string, e.NewValue is still null). I'd like to handle all my validations the same way in the codebehind... but it seems like I have to dig out Destination from the EditingElement ???

Question 2: It seems like the DestinationValidationRule gets activated and gives the combobox a red border. But for some reason, this does not bubble out, making the cell invalidated. Can this be done elegantly in XAML? Or in the code-behind.

To me, it seems like that in order  to make validation, I need a way to hook the cell up with the combobox  (either the rule or the cellvalidation) go most smoothly. Did I miss something?

(I did read http://www.telerik.com/help/wpf/gridview-managing-data-validation.html )
The viewmodel has a property called DriveLog. DriveLog is an observable collections of DriveLogEntryViewModel - each with the property Entry of type DriveLogEntry. DrivLogEntry is a Linq2SQL entity (autogenerated).
Inger Marie
Top achievements
Rank 1
 answered on 19 Jan 2011
7 answers
448 views
Hi,

how to make the gridview auto resize while the user adjusting the window?

thanks
Vanya Pavlova
Telerik team
 answered on 19 Jan 2011
1 answer
103 views
Hi,
I have  a rich text box inside a radwindow, and i want rich text box to expand\ shrink when the size of the window changes and I can't see how this can be done.

Please could someone help me with this?

Thanks

Simon
Konstantina
Telerik team
 answered on 19 Jan 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
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
VirtualKeyboard
HighlightTextBlock
Security
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?