Telerik Forums
UI for WPF Forum
1 answer
125 views
Hi, I need a column chooser for the grid. Most grids have an optional column chooser accessed via an icon in the top left corner of the grid.

I assume you support this - but how do I turn it on ?

Thanks
Yoan
Telerik team
 answered on 06 Aug 2014
2 answers
441 views
I have a RadListBox with an overrided ItemTemplate that uses a RadComboBox as one of its elements. When the combo box's scroll bar is visible, attempting to scroll triggers the drag process in the RadListBox. When I disable drag and drop completely, I am not able to scroll - it appears that the relevant mouse events are being captured by the RadListBox.

Here is the code for the listbox:

<telerik:RadListBox Name="rlbSpices" QueryContinueDrag="rlbSpices_QueryContinueDrag"  telerik:DragDropManager.AllowDrag="True" AllowDrop="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.Row="1" Grid.Column="1" Margin="5" ItemsSource="{Binding RecipeSpices, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemTemplate="{StaticResource SpiceItemTemplate}">
    <telerik:RadListBox.DragVisualProvider>
        <telerik:ScreenshotDragVisualProvider />
    </telerik:RadListBox.DragVisualProvider>
    <telerik:RadListBox.DragDropBehavior>
        <telerik:ListBoxDragDropBehavior AllowReorder="True"  />
    </telerik:RadListBox.DragDropBehavior>
</telerik:RadListBox>

Here is the code for the item template:

<DataTemplate x:Key="SpiceItemTemplate">
    <Grid HorizontalAlignment="Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition Width="30"/>
            <ColumnDefinition Width="25"/>
        </Grid.ColumnDefinitions>
        <local:IngredientCombobox Loaded="IngredientCombobox_Loaded" PreviewMouseMove="IngredientCombobox_PreviewMouseMove" MouseMove="IngredientCombobox_MouseMove" DropDownOpened="IngredientCombobox_DropDownOpened" DropDownClosed="IngredientCombobox_DropDownClosed" Height="20" VerticalAlignment="Top" Grid.Column="0" SelectedItem="{Binding Spice}"/>
        <xctk:DoubleUpDown Grid.Column="1" Height="20" Width="50" Margin="0,0,0,0" VerticalAlignment="Top" FormatString="F2" Value="{Binding Amount}" Increment=".01"  Maximum="1000.00" />
        <TextBlock Grid.Column="2" Margin="5,0,0,0" Text="{Binding Unit.Name}"/>
        <Button Grid.Column="3" Width="25" Height="25" Name="btnRecipeSpiceDelete" Click="btnRecipeSpiceDelete_Click">X</Button>
    </Grid>
</DataTemplate>


I've tried tracking when a combobox is expanded so that I can disable drag/drop at that time, but there seems to be no way to do that effectively. What is the correct way to handle this issue?
Steven
Top achievements
Rank 1
 answered on 06 Aug 2014
4 answers
78 views
I have a window with a gridview control with an image column. The image column displays PNG files on my local disk.
Once I'm done with this dialog (after ShowDialog()) I need to remove the images again from disk.
Unfortunately Windows tells me that the images are still in use by my process although the dialog has been closed successfully (my application still runs of course).

What do I need to do to be able to remove the PNG files after the dialog has been closed?
There is no dispose method for WPF windows. What cleanup do I need to do in the closed event?

Thanks for your help.

Markus

Yoan
Telerik team
 answered on 06 Aug 2014
1 answer
146 views
Hello, I want to use a RadNumericUpDown control in a WPF application. If I do not give the control a name or x:name everything works as expected. If however I provide a name it throws the error below.

What to do? I need to reference the control.



System.Windows.Markup.XamlParseException occurred
  _HResult=-2146233087
  _message='Set connectionId threw an exception.' Line number '6' and line position '29'.
  HResult=-2146233087
  IsTransient=false
  Message='Set connectionId threw an exception.' Line number '6' and line position '29'.
  Source=PresentationFramework
  LineNumber=6
  LinePosition=29
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
  InnerException: System.IO.FileLoadException
       _HResult=-2146234304
       _message=Could not load file or assembly 'Telerik.Windows.Controls.Input, Version=2012.1.326.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
       HResult=-2146234304
       IsTransient=false
       Message=Could not load file or assembly 'Telerik.Windows.Controls.Input, Version=2012.1.326.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
       Source=TemplateNinja.UserControls
       FileName=Telerik.Windows.Controls.Input, Version=2012.1.326.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
       FusionLog==== Pre-bind state information ===
LOG: DisplayName = Telerik.Windows.Controls.Input, Version=2012.1.326.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
 (Fully-specified)
LOG: Appbase = file:///C:/Users/sbaldridge/Source/Workspaces/TemplateNinja/TemplateNinja/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : TemplateNinja.UserControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

Kalin
Telerik team
 answered on 06 Aug 2014
6 answers
318 views
Hi, inside a RadGridView how do I overlay the value on a RadProgressBar control?

So the PercentFilled value below, say 75, will be displayed at 75% on top of the progressbar.

What I have but I can't get it to work:

            <telerik:RadGridView.Columns >
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <telerik:RadProgressBar Minimum="0" Maximum="100" Value="{Binding PercentFilled}"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>

Thanks
R
Top achievements
Rank 1
 answered on 06 Aug 2014
1 answer
166 views
Hi

I have a requirement of loading images in a thumbnail rotator and on click of the thumbnail, open the image in bigger size. The user then should be able to edit the image like adding text etc and should be able to save it back to the database in the blob format.

I am successful in loading the images as thumbnails in a RadRotator control, from the database using datasource.
However, could you advise if it's possible to load the clicked image in a new RadImageEditor control in Rotator.ItemClick event. And then save it back to the database when it's edited (cropped, marked, text added etc)

Thanks
Rama
Top achievements
Rank 1
 answered on 06 Aug 2014
1 answer
383 views
I really like the ControlPanel feature of RadGridView and I am already using the two ControlPanelItems that you provide in your demo section (column chooser and settings) and they work nice. Unfortunately you just provide a ControlPanelItem with a RadDropDownButton in its ControlTemplate but what I want is just a RadButton. To achieve this I've copied the ControlPanelItem classes from your RadGridView SourceCode and created a CustomControlPanelItem. I've also copied the template and style of ControlPanelItem and replaced the RadDropDownButton with RadButton (please see attached screenshot). But now I'm stuck at adding a command to that RadButton. The purpose of the button is to refresh the data in the RadGridView. Can you provide some help how to achieve this goal?
Yoan
Telerik team
 answered on 05 Aug 2014
3 answers
357 views
Hi guys,

The problem is that in the property box we have, when the user types a string in a field that’s bound to a float property the by default  error is displayed. The customer wants  to display some nice user friendly errors.
 
I have a property grid (called AssociatedObject), and for this property grid I add the PropertyDefinitions from code (using a Behavior)  like this:

The AssociatedObject is of type RadPropertyGrid

foreach (CustomerCustomFieldVMv customField in propertyItemsForCompanyList)

            {

                Binding bind = new Binding();

                switch (customField.ValueType)

                {

                    case CustomFieldValueType.Float:

                       
                 //custom field is of type float

                       
              bind = new Binding

                          
           {

                               Source =customField,

                               Path = new PropertyPath("FloatValue"),

                               Mode = BindingMode.TwoWay,

                              
                              UpdateSourceTrigger = UpdateSourceTrigger.LostFocus,

                              
                              ValidatesOnDataErrors = true,

                              
                              NotifyOnValidationError = true

                          
};

                        bind.ValidationRules.Add(new NumericFieldValidation());

                       
                    break;

                    case CustomFieldValueType.String:

                       
                                     //custom field is of type string

                       
                                    bind = new Binding

                           {

                               Source =customField,

                               Path = new PropertyPath("StringValue"),

                               Mode = BindingMode.TwoWay

                          
                    };

                       
                     break;

                    default:

                       
                    break;

                }

                var newDefinition = new PropertyDefinition()

                         
{

                              Binding = bind,

                              DisplayName =
customField.Description,

                              IsReadOnly = false

                         
};

 

               
AssociatedObject.PropertyDefinitions.Add(newDefinition);

            }

The FloatValue property is of type float and the StringValue is of type string. The values are bind and displayed correctly.

 

The class where I want to do the validation is NumericFieldValidation. It’s looking like this:

public class NumericFieldValidation : ValidationRule

    {

        private string invalidInput = “error wrong format”;

 

        // Implementing the abstract method in the Validation Rule class

        public override ValidationResultValidate(object value,System.Globalization.CultureInfo cultureInfo)

        {

            float val;

            if(!string.IsNullOrEmpty((string)value))

            {

                // Validates weather Non numeric values are entered as float value

                if(!float.TryParse(value.ToString(),out val))

                {

                    return new ValidationResult(false,invalidInput);

                }

            }

 

            return new ValidationResult(true,null);

        }

    }

In order to display the errors visual studio throws I use tooltip messages.

<telerik:RadPropertyGrid.Resources>

                <Style TargetType="{x:Type TextBox}">

                    <Style.Triggers>

                       
<Trigger Property="Validation.HasError" Value="True">

                           
<Trigger.Setters>

                                <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self},Path=(Validation.Errors).CurrentItem}"/>

                                <Setter Property="BorderBrush" Value="Red"/>

                                <Setter Property="Background" Value="#FFCCCC"/>

                           
</Trigger.Setters>

                        </Trigger>

</Style>

</telerik:RadPropertyGrid.Resources>

 

The problem I have is that when I type something in the FloatValue field inside the property grid I would like it  to go to the Validate method from NumericFieldValidation, but it’s not. It ignores the Validation rule I added for the FloatValue property.

Can you please help me with a solution? It would be very helpful if the binding would send the user to NumericFieldValidation class for validation.

Best regards,
Adriana
 
Dimitrina
Telerik team
 answered on 05 Aug 2014
1 answer
159 views
Hi,

Is there a way to get how many rows are visible and the index of first row showing in the SrollViewer? I have tried to get ScrollViewer to get ViewPortHeight and VerticalOffset, but they are in pixels instead of the the number of items even if I set CanContentScroll=true?

Thanks in advance.

Cho
Dimitrina
Telerik team
 answered on 05 Aug 2014
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?