Telerik Forums
UI for WPF Forum
0 answers
92 views
Solved, was using wrong property.

Hi,

Event though I have set the WeekGroupHeaderStringFormat property to {}{0:dddd(MM/dd/yy)} it does not appear to affect the header which remains as i.e. 01 Monday. I just wish to have the names of the days displayed as Monday to Sunday without date numbers but seem to be failing, although changing firstDayOfWeek does seem to have an effect. Can anyone help?

<telerik:RadScheduleView Name="_scheduleView"
                                 AppointmentsSource="{Binding Appointments}"
                                 Grid.Row="5"
                                 Grid.ColumnSpan="2"
                                 CurrentDate="2012-10-01"
                                 NavigationHeaderVisibility="Collapsed"
                                 MinAppointmentWidth="10"
                                 MinAppointmentHeight="5"
                                 ShowDialog="RadScheduleView_ShowDialog"
                                 ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
                                 telerik:StyleManager.Theme="Metro">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:WeekViewDefinition FirstDayOfWeek="Monday"
                                            WeekGroupHeaderStringFormat="{}{0:dddd(MM/dd/yy)}">
                </telerik:WeekViewDefinition>
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
Daniel
Top achievements
Rank 1
 asked on 03 Dec 2012
1 answer
60 views
I am after a view, like weekview. However only shows every Friday. 

so it may show every friday, for 7 fridays .

I have no idea where to start. 
Yana
Telerik team
 answered on 03 Dec 2012
0 answers
80 views
Hi ,

i have deleted a value in radgridview cell and moved to another cell still the value is showing in old cell. can you please tell me what i need to do to resolve this?

i am using this control for WPF applications.
Ravindra
Top achievements
Rank 1
 asked on 03 Dec 2012
0 answers
81 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
132 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
817 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
92 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
255 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.0K+ 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
120 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?