Telerik Forums
UI for WPF Forum
0 answers
235 views
Hi Telerik Team,
    I have a scenario in my application as follows:
I have a two combo boxes. One ComboBox has Control Types(such as TextBox, RadButton, ...). If I select any Control Type, the corresponding Control Names which I used in my application will display in the second ComboBox.
(For your understanding purpose : I'm using two RadButtons namely Button1 and Button2 in my application. If I select RadButton in first ComboBox, the names "Button1" and "Button2" will display in the second ComboBox). It is done.

Similarly, I wanna get the MenuItem's Names I used under RadGridView. But it is not getting the MenuItems. Please kindly reply me how to acheive this.

The following is the code I've used to get the names of the selected control type:

 

Private

 

 

Sub GetControlNames(ByVal oControl As Object)
Try
    
If IsNothing(oControl) Then GoTo lable1

 

    Dim child As Object 
    
If oControl.GetType.Name = "String" Then GoTo lable1 
    For Each child In LogicalTreeHelper.GetChildren(oControl)

 

        If sSelectedControl = child.GetType.Name Then 
            
cmbControlsName.Items.Add(child.Name)

 

        End If 
        
GetControlNames(child)

 

    Next

 

 

 

lable1:

    Catch ex As Exception 
        
ShowMessage(ex.Message)

 

 

 

    End Try
End Sub

 

 

Note: I have the above said two ComboBoxes and a Frame in one Page and the Frame will load another page namely Page1 in it. The content of the Frame will be passed as the argument for the above function.

Here, I have used the Recursive function(well you know). When the RadGridView is passed as the argument of the function, it jumps to the label "lable1" from "For Each" statement. So, it means the RadGridView doesn't have children. Then, how can I get the MenuItem I've used under RadGridView. Please let me know the solution.

Thanks and Regards,
Azharshah H
Software Developer

azhar
Top achievements
Rank 1
 asked on 16 Apr 2011
2 answers
86 views
I have a class that extends Appointment like so:
public class AppointmentTaskVm : Appointment
{
  private int _appointmentTaskId;
  private bool _isBasketItem;
  private int _position;
  private int? _taskId;
  public int AppointmentTaskId
  {
    get { return _appointmentTaskId; }
    set
    {
      _appointmentTaskId = value;
      OnPropertyChanged("AppointmentTaskId");
    }
  }
  public bool IsBasketItem
  {
    get { return _isBasketItem; }
    set
    {
      _isBasketItem = value;
      OnPropertyChanged("IsBasketItem");
    }
  }
  public int Position
  {
    get { return _position; }
    set
    {
      _position = value;
      OnPropertyChanged("Position");
    }
  }
  public int? TaskId
  {
    get { return _taskId; }
    set
    {
      _taskId = value;
      OnPropertyChanged("TaskId");
    }
  }
  public override IAppointment Copy()
  {
    var newAppointment = new AppointmentTaskVm();
    newAppointment.CopyFrom(this);
    return newAppointment;
  }
  public override void CopyFrom(IAppointment other)
  {
    var task = other as AppointmentTaskVm;
    if (task != null)
    {
      AppointmentTaskId = task.AppointmentTaskId;
      IsBasketItem = task.IsBasketItem;
      Position = task.Position;
      TaskId = task.TaskId;
    }
    base.CopyFrom(other);
  }
}

Dragging the AppointmentTaskVm from a ListBox to the ScheduleView causes the Copy and CopyFrom to fire multiple times. This results in the additional properties in the AppointmentTaskVm to loose thier values.

Subscribing to the AppointmentCreated event of the ScheduleView shows that the new AppointmentTaskVm additional properties are initialised with default values (instead of copying the values from the original AppointmentTaskVm).


David
Top achievements
Rank 1
 answered on 16 Apr 2011
6 answers
355 views

Hi,

I am trying to select values from a bounded combobox inside a GridView.
But after a select it and try to select other the previous selected value is not visible.

below is code in xaml :-
 

<telerik:RadGridView Margin="5,0,0,0" Grid.Row="4" Grid.ColumnSpan="2" Name="gvGISMapFields" Width="610" ShowColumnHeaders="True" ShowGroupPanel="False" Height="250">
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn Name="MatchingField" DisplayMemberPath="MatchingField" UniqueName="MatchingField" HeaderText="Target Field"  IsFilterable="False" IsGroupable="False" IsReorderable="False" IsSortable="False" TextAlignment="Center" Width="250"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

below is code in xaml.cs :-

GridViewComboBoxColumn matchingField = (GridViewComboBoxColumn)gvMapFields.Columns[1];
matchingField.ItemsSource = matchingGISFields;

Helio
Top achievements
Rank 2
 answered on 15 Apr 2011
3 answers
762 views
Hello,
    I have a checkbox column in my grid but it appears left justified. I want to center it but have not found the command or event where to do this.
Any help would be appreciated.
Thanks

Vanya Pavlova
Telerik team
 answered on 15 Apr 2011
1 answer
134 views
I am just starting out, and trying to use data binding to display a parent child relationship.

I need to first have the user select in a ComboBox my List of "Currency" objects and display in a Grid the related "CurrencyRates" collection of the selected currency object

I can see the list of currencies in the combo when I bind the ItemsSource property to the DataContext
<telerik:RadComboBox ItemsSource="{Binding}" DisplayMemberPath="Name" x:Name="cboCurrencyList"  />


I am not sure how to get a Grid to show the child collection CurrencyRates.... I've tried the code below but didn't work
Source="{Binding ElementName=cboCurrencyList, Path=SelectedValue}"/>

I am using EF4

Valeri Hristov
Telerik team
 answered on 15 Apr 2011
1 answer
65 views
Hi,

I'm trying to show a radgridview into a radtreelistview item.
Now i bind the treelistview with "Capitulos" Items and i have the next structure:

                 Capitulo 1
                        Capitulo 1.1
                               Capitulo 1.1.1
                 Capitulo 2
                 Capitulo 3


I need to show this one:

                    Capitulo 1
                        Capitulo 1.1
                            Product c
                            Product d
                            Product e
                                Capitulo 1.1.1
                                        Product a
                                        Product b
                    Capitulo 2
                    Capitulo 3
                        

        
Ivan Ivanov
Telerik team
 answered on 15 Apr 2011
2 answers
219 views
Hi Telerik,

I've had a somewhat similar thread sometime ago, but here is what I need to do:

Basically what I want to achieve is to add some custom object to the CalendarButtonContent for my DataTemplate to access.

I have created a template selector and finding that the given date is a Holiday, then returning my HolidayTemplate.

public class CalendarButtonTemplateSelector : DataTemplateSelector
{
    public override DataTemplate SelectTemplate(object item, DependencyObject container)
    {
        CalendarButtonContent content = item as CalendarButtonContent;
        if (content != null && content.ButtonType == CalendarButtonType.Date)
        {
            if (CentralCalendarWindow.CalendarViewItems != null && CentralCalendarWindow.CalendarViewItems.Exists(c => c.Date == content.Date))
            {
                CalendarViewItem calendarViewItem = CentralCalendarWindow.CalendarViewItems.Find(c => c.Date == content.Date);
                if (calendarViewItem.IsHoliday)
                {
                    return HolidayTemplate;
                }
            }
        }
    }
}

In XAML I would like my template to achieve something like the following (where CustomText is the object somehow added to the CalendarButtonContent or otherwise referenced):

<DataTemplate>
    <StackPanel>
        <TextBlock Text="{Binding Text}" />
        <TextBlock Text="{Binding CustomText}" />
    </StackPanel>
</DataTemplate>

I would be happy if I could somehow from my template just access some custom data outside the scope of the CalendarButtonContent, i.e. some static public data, if this would somehow be possible, but I guess that has not really anything to do with your Calendar control :)

Thanks in advance!
Best regards,
Kasper Schou
Kasper Schou
Top achievements
Rank 1
 answered on 15 Apr 2011
4 answers
132 views
Hi Telerik,

This is somewhat a spinoff of my previous thread.

My question here is whether or not it is possible to inherit from the CalendarButtonContent and having RadCalendar use this instead?, i.e. adding a Color property that could be set in code behind when selecting template, then binding to this Color property in the template definition in xaml?

Again, this is a simple example and my real case scenario contains many properties, hence having different templates for each combination of custom properties is not a desired approach.

Any advice what be appriciated :)

Best regards,
Kasper Schou
Kasper Schou
Top achievements
Rank 1
 answered on 15 Apr 2011
2 answers
114 views

Hi,

I've created a button column (using the example in the GridView help file, GridViewColumn & CellTemplace) but I would like to alter the tab navigation behaviour.

Right now it's "Previous Cell -> Button Cell -> Button in button Cell -> Next Cell" and I want "Previous Cell -> Button in button Cell -> Next Cell".

Also when using shift-tab to go backward it's "Next Cell -> Button Cell -> Previous Cell" and I want "Next Cell -> Button in button Cell -> Previous Cell".

Is there any way to do this because it makes keyboard navigation more confusing especially if you want to activate the button by pressing space?

I can't seem to find a way to make this work. I hope you can help me.

Thanks

Ivan Ivanov
Telerik team
 answered on 15 Apr 2011
1 answer
123 views
Hi,

  I want that the date should be displayed as mm-dd-yyyy instead of mm/dd/yyyy. In simple words I can say I want to display '-' instead of '/'. Please let me know how to achieve this. If I need to use a culture can u tell me the culture name for this.

Thanks.
Boyan
Telerik team
 answered on 15 Apr 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
DataPager
PersistenceFramework
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?