Telerik Forums
UI for WPF Forum
0 answers
103 views
Hi All,

I am adding the new Row in RowEditEnded Event. When the RowEditEnded is called it Creates two empty Rows. Also when i press Shift+Tab to move focus to previous cell's and focus tries to move previous row it again calls the roweditended and creates the Two Empty Rows. Expected behavior is it should change the focus to previous row.

Also one more thing when i load the GridView it should be with one Empty Row.

Any workaround for this 2 issues.

private void playersGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {           
            e.NewObject = new Player();
        }
  
        private void playersGrid_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
        {
            if (e.EditAction == GridViewEditAction.Cancel)
            {
                return;
            }
            if ( e.EditAction == GridViewEditAction.Commit)
            {
                this.playersGrid.CurrentColumn = this.playersGrid.Columns.OfType<GridViewColumn>().First();
                this.playersGrid.BeginInsert();
            }
        }

Thanks and Regards,
Sakthi
Sakthi
Top achievements
Rank 1
 asked on 03 Dec 2012
2 answers
153 views
HI!
i have a raddataform with a datagrid, the problem is that when i click "delete" on the raddataform there is any "confirmation" like "are u sure to delete blabla" , it makes all the process automatic.

its possible to put a confirmation in that button? i mean the button with a "trash can icon", in raddataform? im using WPF C#. like a dialog window "yes/no"

also my button cancel and ok in "delete mode" are disabled.

Thanks in advance,
Dempsey
Top achievements
Rank 1
 answered on 02 Dec 2012
12 answers
866 views
Hello, I need to get the text under the caret, my position has to check a text format and retrieve it. This format is "Code, delimiter, keywords"

Example: "CODE1;,;CODE2;?;CODE3"

When the user presses F11, a function must retrieve the text regardless of the position of the caret in the text (beginning, middle, end)

I tried, but every time I have only pieces of text, I can not get the entire text.
Iva Toteva
Telerik team
 answered on 30 Nov 2012
1 answer
118 views
Hello,

Here is the scenario: one autocomplete and one button(mvvm with mvvmlight). The Button is enabled only(canexecute command) if the SelectedItem property is null. If the list of suggestions expands beyond the window, two behaviors can occur:
  • If the elemet clicked  is over the window, the command is evaluated immediately.
  • If the element clicked is beyond the window(as in the screenshot), the command is not evaluated until the componebt lose focus.



<Window x:Class="WpfApplication1.TestAutoComplete"
         xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="TestAutoComplete" Height="100" Width="100"
        DataContext="{Binding TestAutoCompleteBinding, Source={StaticResource Locator}}">
    <Grid>
        <StackPanel Orientation="Vertical">
            <telerik:RadAutoCompleteBox ItemsSource="{Binding Source,Mode=TwoWay}" AutoCompleteMode="Suggest" SelectionMode="Single" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" DisplayMemberPath="FirstName"/>
            <Button Command="{Binding TestCommand}" Content="test"/>
        </StackPanel>
    </Grid>
</Window>


public class TestAutoCompleteViewModel : ViewModelBase
 {
     public ObservableCollection<Customer> _source;
 
     public ObservableCollection<Customer> Source
     {
         get
         {
             return this._source;
         }
         set
         {
             this._source = value;
             this.RaisePropertyChanged(() => this.Source);
         }
     }
 
     private ICommand _testCommand;
 
     public ICommand TestCommand
     {
         get
         {
             return this._testCommand;
         }
     }
 
     private Customer _selectedItem;
 
     public Customer SelectedItem
     {
         get
         {
             return this._selectedItem;
         }
         set
         {
             this._selectedItem = value;
             this.RaisePropertyChanged(() => this.SelectedItem);
         }
     }
 
     /// <summary>
     /// Initializes a new instance of the <see cref="TestAutoCompleteViewModel" /> class.
     /// </summary>
     public TestAutoCompleteViewModel()
     {
         var customers = new List<Customer>();
         customers.Add(new Customer("testLast1", "testFirst1"));
         customers.Add(new Customer("testLast2", "testFirst2"));
         customers.Add(new Customer("testLast3", "testFirst3"));
         customers.Add(new Customer("testLast4", "testFirst4"));
         customers.Add(new Customer("testLast5", "testFirst5"));
         customers.Add(new Customer("testLast6", "testFirst6"));
         this.Source = new ObservableCollection<Customer>(customers);
         this._testCommand = new RelayCommand(() => { }, () =>
         {
             return this.SelectedItem != null;
         });
     }
 }
Ivo
Telerik team
 answered on 30 Nov 2012
5 answers
282 views
I am using a GridView in a master - detail, MVVM, Prism scenario.  When I navigate to the master, I want to set the selected item to an item whose ID is passed in during navigation.  The difficulty I am having is that appears that the Selected Item is being set in the modelview before the GridView data loading is complete.  In debug, I can see that the Selected Item is getting set properly and PropertyChanged is raised for the operation.  Subsequent to this, the Selected Item is getting reset to a different value from the GridView via the TwoWay binding, I'm guessing after data loading has been completed by the GridView.  How can I ensure that the selection being made from within the viewmodel does not get overriden by the loading operation of the GridView?  Here are some code snippets:
public void OnNavigatedTo(NavigationContext navigationContext)
{
    // Called to initialize views during navigation.
 
    // Is this for AgentView?
    if (navigationContext.Uri.ToString().Contains("AgentsView"))
    {
        // The ID of the item to be displayed is passed as a navigation parameter.
        // ToInt32 can throw FormatException or OverflowException.
        try
        {
            int id = Convert.ToInt32(navigationContext.Parameters["PersonID"]);
            if (id == 0) return;
 
            // Retrieve the specified item using the data service.
            var agent = new DAL.Agent();
            _agentsDataService.GetSelectedAgent(id, GetAgentsCallback);
         }
        catch (FormatException e)
        {
            //Console.WriteLine("Input string is not a sequence of digits.");
            //return CurrentItem == null ? false : CurrentItem.Id.Equals(id);
        }
    }
}
 
private void GetAgentsCallback(DAL.Agent agent)
{
    _navigatedToAgent = agent;
    if (_navigatedToAgent != null)
    {
        SelectedAgent = _navigatedToAgent;
    }
}
 
public DAL.Agent SelectedAgent
{
    get { return _selectedAgent; }
    set
    {
        if (_selectedAgent == value) return;
        _selectedAgent = value;
        RaisePropertyChanged(() => SelectedAgent);
        _eventAggregator.GetEvent<AgentSelectedEvent>().Publish(_selectedAgent);
    }
}

SelectedItem="{Binding SelectedAgent, Mode=TwoWay}"
Dimitrina
Telerik team
 answered on 30 Nov 2012
4 answers
1.1K+ views
Hi,

I am creating a generic grid solution based on the Telerik grid as a prototype to test the suitability of the Telerik components.

Our data layer can not send us typed objects. Instead it sends an object with an array of field names and an array of values.

Arrays
My first approach was to use a binding expression referencing the index to display i.e:

DataMemberBinding="{Binding Path=Values[0]}"

The grid does retrieve the values using this expression, but grouping, sorting and filtering are missing.

Dynamic object
Since this didn't work I thought I could trick the grid into thinking the model was strongly typed using a dynamic object that returned values based on the binding name:

public override bool TryGetMember(GetMemberBinder binder, out object result)
{
    if (!this.AllFields.Contains(binder.Name))
    {
        return base.TryGetMember(binder, out result);
    }
 
    result = this.Values[this.AllFields.IndexOf(binder.Name)];
    return true;
}
This fixed grouping and sorting however filtering is still not working

I've have a simplified test project that demonstrates my findings, but the forum won't allow me to attach it. Any help resolving this issue would be most welcome.
Edward Wilde
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
140 views
Hello!

As it is currently designed in the telerik no mater what I do I always get the limits labels over Scale's path border.
But I would like to have all the labels inside the scale's bar as in attached image...

( <Gauges:LabelProperties Location="OverCenter" /> )

How is that possible?

Thank you
Andrey
Telerik team
 answered on 30 Nov 2012
2 answers
161 views
Hello,

cant start my applikation with new internal build 1126

An exception of type 'System.ArgumentNullException' occurred in Telerik.Windows.Controls.dll 

Additional information: Value cannot be null.

>   Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.CheckNotNull(System.Windows.DependencyObject element, System.Delegate handler) Line 1168  C#
    Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.RemoveDragOverHandler(System.Windows.DependencyObject element, Telerik.Windows.DragDrop.DragEventHandler handler) Line 789    C#
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FrozenColumnsSplitter.UnSubscribeFromMouseEvents() Line 255 C#
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.FrozenColumnsSplitter.FrozenColumnsSplitter_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) Line 136   C#
    [External Code]
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(System.Windows.Size availableSize) Line 197 + 0x25 bytes    C#
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(System.Windows.Size availableSize) Line 215 + 0x2c bytes  C#
    [External Code]
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size constraint) Line 173 + 0x25 bytes  C#
    [External Code]
    Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(System.Windows.Size availableSize) Line 6587 + 0x2b bytes   C#
    [External Code]
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.WindowHostWindow.MeasureOverride(System.Windows.Size availableSize) Line 341 + 0x28 bytes  C#
    [External Code]
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(bool isModal) Line 40 C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.ShowWindow(bool isModal) Line 864   C#
    Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadWindow.Show() Line 386  C#
    IZTMediaLibrary.dll!IZTMediaLibrary.Starter.Run() Line 27   C#
    IZT Signal Suite Database.exe!wWinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, wchar_t* lpCmdLine, int nCmdShow) Line 75    C++
    IZT Signal Suite Database.exe!__tmainCRTStartup()  Line 547 + 0x1c bytes    C
    [External Code]
    mscoreei.dll!70d655ab()    
    [Frames below may be incorrect and/or missing, no symbols loaded for mscoreei.dll] 
    mscoree.dll!70dd7f16() 
    mscoree.dll!70dd4de3() 
    kernel32.dll!764033aa()    
    ntdll.dll!77829ef2()   
    ntdll.dll!77829ec5()   
steven littleford
Top achievements
Rank 1
 answered on 30 Nov 2012
1 answer
245 views
hi all, can u help me to understand what's wrong in this style?

PocVertex is a ViewModel object representing the diagram Node.

<Style x:Key="PocNodeStyle" TargetType="telerik:RadDiagramShape">
        <Setter Property="Position" Value="{Binding Position, Mode=TwoWay}" />
        <Setter Property="Width" Value="200" />
        <Setter Property="Height" Value="50" />
        <Setter Property="IsConnectorsManipulationEnabled" Value="False" />
        <Setter Property="IsRotationEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <DataTemplate DataType="{x:Type local:PocVertex}">
                    <ContentControl>
                        <Border Name="bd" Background="#FFE3E3E3"
                                BorderBrush="{Binding Path=.,Converter={StaticResource nodeBorderColorConverter}}"
                                BorderThickness="5,3,5,3"
                                CornerRadius="10,10,10,10"
                                Padding="10,5,10,5">
                            <Border.ContextMenu>
                                <ContextMenu    >
                                    <MenuItem x:Name="miCollega"                              Header="collega con" />
                                    <MenuItem x:Name="miCollega_Opzione"                      Header="collega con opzione" />
                                    <MenuItem x:Name="miElimina"                              Header="elimina" />
                                    <MenuItem x:Name="miElimina_Collegamenti"                 Header="elimina collegamenti" />
                                    <MenuItem x:Name="miRadice"                               Header="Imposta come radice" />
                                    <MenuItem x:Name="miDuplica"                              Header="duplica nodo" />
                                    <MenuItem x:Name="miCopiaNodo"                            Header="copia nodo" />
                                    <MenuItem x:Name="miEmail"                                Header="invia email"           />
                                    <!--ItemsSource="{Binding Source={x:Static s:Settings.Default}, Path=Emails, Mode=TwoWay}"-->
                                    <MenuItem x:Name="miNuovo"                                    Header="nuovo nodo"  >
                                        <MenuItem x:Name="miNuovo_Diretto"                        Header="diretto" />
                                        <MenuItem x:Name="miNuovo_Opzione"                        Header="opzione" />
                                    </MenuItem>
                                    <MenuItem x:Name="miIsolaNodo"                                Header="isola nodo" />
                                </ContextMenu>
                            </Border.ContextMenu>
                            <TextBlock Name="txtCaption" Text="{Binding Caption}"  ToolTip="{Binding Text}"/>
                        </Border>
                    </ContentControl>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=IsRoot}" Value="True">
                            <DataTrigger.Setters>
                                <Setter Property="TextDecorations" Value="Underline" TargetName="txtCaption" />
                            </DataTrigger.Setters>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=IsHighlighted}" Value="True">
                            <DataTrigger.Setters>
                                <Setter Property="BorderBrush" Value="Red" TargetName="bd" />
                            </DataTrigger.Setters>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=IsSelected}" Value="True">
                            <DataTrigger.Setters>
                                <Setter Property="Background" Value="Yellow" TargetName="bd" />
                            </DataTrigger.Setters>
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
Tina Stancheva
Telerik team
 answered on 30 Nov 2012
1 answer
95 views
Hi,

I have used a candlestick and a barchart in same page. When I changed the zooming parameters and scrolling the scrollbar, the candlestick's DateTimeCategoricalAxis display has some problem, please see the picture.
Peshito
Telerik team
 answered on 30 Nov 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
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
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?