Telerik Forums
UI for WPF Forum
5 answers
570 views
We have two RadTreeViews on a form. Tree1 contains a list of items (single level) that can be added to different groups in Tree2. Assume the following default tree items:

Tree 1 (these items are static and cannot change. If you drag and drop, it copies the item instead of moving)
------------
Item 1
Item 2
Item 3
etc...

Tree 2
------------
Group A
Group B
Group C

Say I drag 'Item 1' to add it to both 'Group A' and 'Group B'. So Tree 2 now looks like:

Group A
- Item 1
Group B
- Item 1
Group C

If I click to select 'Item 1' in 'Group B' it selects 'Item 1' in 'Group A'. It seems like when making a selection, it searches the tree from the top-down for the item that was clicked on and selects the first occurrence. So if I ever try to drag 'Item 1' from 'Group B' and move it to 'Group C', it will actually move 'Item 1' from 'Group A' to 'Group C'.

I apologize if that seems confusing, not sure if I can explain it any better though. It's a really strange behavior and I'm sure it is not intended; however, I may be doing something wrong as well. I created 'HierarchicalDataTemplate' and 'DataTemplate' to set how the data displays my view model. I am also using the 'new' DragDropManager as well. The version of components we are using is 2013.3.1316.45 (we decided to not renew the license so this is the latest version available to us).

Is there something I could be doing wrong? Is there a work around I could use?

Thanks for any help
Brian
Top achievements
Rank 1
 answered on 01 May 2014
2 answers
1.0K+ views
As per title, when I click to add a new row in my RadGridView, I would like my RadDatePicker column to auto display today's date rather than 1/1/0001.
Is there any way to do this? I've tried to set various properties at design time such as DisplayDate, DateTextTime, SelectedDate but all doesn't make a difference.

I would perhaps try to do it at code-behind rather than design time, but I have no idea how to access it.
Anyways here are my codes currently:

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SvcDate}" UniqueName="SvcDate"
                                            TextWrapping="Wrap" Width="100" TextAlignment="Center" DataFormatString="{}{0:ddMMyy}">
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Service Date" TextAlignment="Center"/>
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadDatePicker SelectedValue="{Binding Path=SvcDate}"
                                                   DateTimeWatermarkContent="Service"
                                                   ErrorTooltipContent="Unrecognised format. Use drop-down interface for input assistance."
                                                   Culture="en-SG" DisplayDateStart="01/01/2014">
                            </telerik:RadDatePicker>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>

Dimitrina
Telerik team
 answered on 01 May 2014
12 answers
430 views
I have formatted a column in a gridview by using the dataformatstring attribute {0:P0}.
This changes my 0.32 values to 32 and displays percentages as I want it to, but when entering a value in the field filters, I need to enter the original value to get it to filter correctly. e.g 0.32 for 32

I'm hoping there is an easy way of intercepting the 32 value and changing it back to 0.32 for the purposes of filtering.

I've tried using the FieldFilterEditorCreated event on the grid and accessing the e.Editor (which seems to be a textbox with more properties), but I can't see anything in there that allows me to hijack the value and change it from 32 to 0.32.
I've also tried using the Filtering Event, and successfully transformed the 'Value' property of the filterdescriptors, but this change does not seem to be retained/passed through to the datasource

I'm aware that it could be that I need to create a new custom filtering control, but this seems very laborious, when all I want to do is retain the formatting of the column when filtering. 

I have three questions really, 
(1) Is there a way of transforming/intercepting the value passed to the datasource for filtering?
(2) Is creating a new custom filtering control the only way to do what I need to do
(3) If so, is there an example I can follow that focusses on the textbox filtering control, as opposed to the date filter as in this tutorial http://www.telerik.com/help/wpf/gridview-filtering-custom-filtering-controls.html

Many thanks
Alan
Dimitrina
Telerik team
 answered on 01 May 2014
5 answers
168 views
I'm using a RadDataForm with auto-generated fields and field edit controls. In case it's important, the RadDataForm is bound to a DataView. Due to the datatypes involved, most of the auto-generated edit controls are simply text boxes.  When I tab from one editable field to another, I'd expect the current contents to be "selected" so I could either 1) tab past an existing value or 2) quickly change it.

Currently however, the insert cursor is placed in the field - sometimes at the end of the existing data and sometimes at the beginning (I haven't determined what controls its location). So, if I just press <TAB> to advance to the next field and start typing some new data, it's *added* (either prepended or appended based on cursor position) to the existing data instead of overwriting it as I'd expect.

How can I force the current contents of each text box to be automatically selected when the control receives focus?

Jeff
Phillip
Top achievements
Rank 1
 answered on 30 Apr 2014
1 answer
169 views
I want a binding ICommand to the Click event of a button in ControlPanelitem. But it does not work. And I Binding SelectedValue of RadDatePicker control in ControlPanelItem and it also does not work. ControlPanelItem support from the model not binding?
luc
Top achievements
Rank 1
 answered on 30 Apr 2014
1 answer
190 views


 I have used the rich text box control to save the data in the lost focus event and the lost focus event is repeatedly getting fire while typing each characters in control.

   please let me know how to resolve this problem.Any help is appreciated.
Missing User
 answered on 30 Apr 2014
2 answers
266 views
I am using RadGridView to edit my business object.  My business object implements IEditableObject interface.  My requirements states each row should be edited, saved or cancelled only using buttons in that row(sort of like the behavior in asp.net's grid).  I have looked at this post and this post:
http://www.telerik.com/forums/do-not-call-endedit-on-leaving-row
http://www.telerik.com/forums/gridview-cancel-endedit

and I have also achieved the endedit and cancel edit effect using the following code:
<Button  Content="Save" CommandParameter="{Binding}" Command="telerik:RadGridViewCommands.CommitEdit"></Button>
<Button  Content="Cancel" CommandParameter="{Binding}" Command="telerik:RadGridViewCommands.CancelRowEdit"></Button>

The problem is, the default behavior of the RadGridView calls EndEdit on my businessObject even when the user selects another row either using the keyboard or the mouse click, and in the EndEdit row event lifecycles, the only event that gets called before EndEdit on the IEditableObject is called is the Row_Validating event.  So to cancel the action, that's probably the only event I where I can handle it and setting the isvalid to false.  This seems to me like a hack and it interfere with the actual business object validation.  Why isn't there a RowEditEnding event that we can use for canceling? Is there a more natural way of doing this beside handling the Row_Validating event?  Also, what are all the events that will trigger the EndEdit for the row beside left mouse click?  I would like to handle them all in the worse case scenario if there are no better way of doing this.

Yoan
Telerik team
 answered on 30 Apr 2014
1 answer
181 views
Hi,

I would like to know if it's possible to implement an interactive tooltip??? I mean by interactive tooltip, a tooltip whick contain button and close when the button was clicked.

Thank's
Alain
Konstantina
Telerik team
 answered on 30 Apr 2014
2 answers
144 views
I've added a "CapacityBar" to the TimeRulerItem as seen in the attached image. The text and progress bar are supposed to show how full each day is based on the currently displayed appointments. As seen in the image, this does currently work the first time the view is displayed. When the user makes a change that causes the AppointmentFilter to show different appointments, the capacity bar is not updated.

Here's how I added the capacity bar:
<telerikScheduleView:TimeRulerItemTemplateSelector.MonthItemTemplate>
    <DataTemplate>
        <DataTemplate.Resources>
            <converters:DateToCapacityBarCountConverter x:Key="DateToCapacityBarCountConverter" />
            <converters:DateToCapacityBarPercentConverter x:Key="DateToCapacityBarPercentConverter" />
            <converters:DateToCapacityBarVisibleConverter x:Key="DateToCapacityBarVisibleConverter" />
        </DataTemplate.Resources>
        <Grid Margin="6 2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding FormattedValue}" Grid.Row="0" Grid.Column="0"/>
            <Grid Margin="6 2" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="1" >
                <Grid.Visibility>
                    <MultiBinding Converter="{StaticResource DateToCapacityBarVisibleConverter}">
                        <Binding Path="DateTime" Mode="OneWay"/>
                        <Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}" />
                    </MultiBinding>
                </Grid.Visibility>
                <telerik:RadProgressBar Minimum="0" Maximum="100">
                    <telerik:RadProgressBar.Value>
                        <MultiBinding Converter="{StaticResource DateToCapacityBarPercentConverter}">
                            <Binding Path="DateTime" Mode="OneWay"/>
                            <Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}" UpdateSourceTrigger="PropertyChanged" />
                        </MultiBinding>
                    </telerik:RadProgressBar.Value>
                </telerik:RadProgressBar>
                <TextBlock Margin="0" HorizontalAlignment="Center">
                    <TextBlock.Text>
                        <MultiBinding Converter="{StaticResource DateToCapacityBarCountConverter}">
                            <Binding Path="DateTime" />
                            <Binding Path="DataContext" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadScheduleView}}" UpdateSourceTrigger="PropertyChanged" />
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
            </Grid>
        </Grid>
    </DataTemplate>
</telerikScheduleView:TimeRulerItemTemplateSelector.MonthItemTemplate>


How can I get the capacity bar to refresh? I've tried doing an OnPropertyChange(null) in my ViewModel to get all properties to update, but since this doesn't really seem bound to any specific property directly, that doesn't work. Is there a better way of doing this binding? How can I get this to work the way I'd like?

I'm sorry if this is a general WPF binding question instead of specific to telerik, but it had enough telerik details that I didn't think it was appropriate for a generic WPF forum.

Thank you!



Brian
Top achievements
Rank 1
 answered on 30 Apr 2014
1 answer
108 views
Hello, 

I need help because I have used a RadTreeListView and I have to generate from code behind. 

I can not seem to generate my TreeListView, I use a dataset because I can not use a class object as the number of columns is dynamic and may vary depending on the user selection. 

Would you have an example to dynamically génrérer from the code behind a TreeViewList. 

It must also be able to create the hierarchy from the code behind. 

Thank you for your help, I'm looking for 5 days on the Internet and I have found nothing to help me. 

Thank you in advance for your help. 

Mickaël
Nick
Telerik team
 answered on 30 Apr 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
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?