Telerik Forums
UI for WPF Forum
7 answers
218 views
Any type of control which has a drop down, like ComboBox, Listbox become hidden when clicked within a RadWindow.
It seems to happen on Windows XP machines.

If you set the radwindow to IsTopMost then the combobox is visible, but I do not want to use this method.
I have tried a lot of things, but with no success. (including setting zindex)

Is this a bug with radwindow, and is there a workaround? I am using mvvm, so would rather not have to do any code behind.
Georgi
Telerik team
 answered on 04 Apr 2012
0 answers
127 views
Hello,

I wanted to set a few rows in my grid to readonly...I did not see the Readonly property for a row...
I got a piece of code which successfully disable my rows....but it's nt exactly what i wanted.

Code :

 

 

public void MakeExistingRowsReadOnly()

 

{

 

 

if (this.Items.ItemCount != 0)

 

{

 

 

for (int i = 0; i < this.Items.Count; i++)

 

{

 

 

GridViewRow currentrow = (GridViewRow)this.ItemContainerGenerator.ContainerFromItem(this.Items[i]);

 

 

 

if (!currentrow.Equals(null))

 

{

currentrow.IsEnabled =

 

false;

 

 

}

}

}

}


With this code...it disables the rows completely. The user can copy a cell etc.
what i want to achieve ios that...when the user is in the add mode...certain rows only are ReadOnly whereby he won't be able to enter values in that row. But he can copy data from the Readonly rows, can navigate etc.

Right now with this code, navigation and copying the data has been lost.

Can anyone please help...How can we make rows Readonly...without losing other features?

Regards
Shaimaa
Shaimaa
Top achievements
Rank 1
 asked on 04 Apr 2012
1 answer
198 views
Our scenario is as follows:

We have 4 tabitems for a RadTabControl (Tab1, Tab2, Tab3, Tab4) in this order and Tab1 is set as the selected tab when the RadTabControl is loaded for the first time.

The parent user control that wraps this RadTabControl when tries to find the Tab4 (without Tab4 set to focus or a manual user selection), the following code we run by in Framework is unable to locate it.. 

To reiterate the point, if that Tab4 is set as the first tab item or has focus or has a manual user selection - the same piece of code locates the Tab4.

        private static T FindChild<T>(DependencyObject parent) where T : DependencyObject

        {

            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)

            {

                DependencyObject child = VisualTreeHelper.GetChild(parent, i);

                if (child != null && child is T)

                    return (T)child;

                else

                {

                    T childOfChild = FindChild<T>(child);

                    if (childOfChild != null)

                        return childOfChild;

                }

            }

            return null;

        }


Let us know if there is a property that we can apply for a specific RadTabItem to ensure the tabitem object is created as soon as the RadTabControl (as a container object) is created/loaded.

Thanks much
Kam Panchal
Hristo
Telerik team
 answered on 04 Apr 2012
2 answers
148 views
Hello,
Suppose we have this XAML :

<StackPanel>
    <telerik:RadTransitionControl x:Name="tr1">
        <Label x:Name="lblMessage"></Label>
    </telerik:RadTransitionControl>
    <Button Content="Button"  Height="23" Name="button1" Width="75" Click="button1_Click" />
</StackPanel>

and when button1_Click has this code :
tr1.Content = DateTime.Now.ToString();
It works well.
 But replacing it with this code :
lblMessage.Content = DateTime.Now.ToString();
causes the transition to not to work !

It seems that it only detects first layer changes in content and doesn't detect deep change.

So have I forgotten something here or its the nature of this control ?

Regards,
MahMah
Top achievements
Rank 1
 answered on 04 Apr 2012
2 answers
145 views
Hi,
I am pretty new to WPF,i hav been cracking my head for a day and still no go ,
I need a grid view and some labels to appear in the popup.. while trying to keep the popup similar to the WPF demos..
Attaching a picture for refrence...

Thank you
Regards
Saneesh-B
Saneesh
Top achievements
Rank 1
 answered on 04 Apr 2012
0 answers
107 views
Hello!

I would like to achieve this result as show in the picture (attachment).
Should I use RadGridView control? Or maybe there is some way to use ListBox instead of GridView?

I have my object's class:

public class Reinforcement
   {
       private string fi;
       private bool spacingMode;
       private int amount;
       private double spacing;
       private bool combine = false;
       private double area;
 
       public Reinforcement()
       {
       }
 
       public Reinforcement(string fi, bool spacingMode, int amount, double spacing, bool combine)
       {
           Fi = fi;
           SpacingMode = spacingMode;
           Amount = amount;
           Spacing = spacing;
           Combine = combine;
       }
 
       public string Fi
       {
           get
           {
               return this.fi;
           }
           set
           {
               this.fi = value;
           }
       }
         // (...) 
}


And ViewModel:

public class ReinforcementViewModel
    {
        private static ObservableCollection<Reinforcement> reinforcementsByAmount;
        private static ObservableCollection<Reinforcement> reinforcementsBySpacing;
 
        public static ObservableCollection<Reinforcement> ReinforcementByAmount
        {
            get
            {
                if (reinforcementsByAmount == null)
                {
                    reinforcementsByAmount = new ObservableCollection<Reinforcement>();
 
                    for (int i = 1; i <= 10; i++)
                    {
                        reinforcementsByAmount.Add(new Reinforcement("10", false, i, 1, false));
                        reinforcementsByAmount.Add(new Reinforcement("12", false, i, 1, false));
 (...)
                    }
                }
 
                return reinforcementsByAmount;
            }
        }


Any ideas or/and tips for me?

I thought that with ListBox I could use panel with specify width and each cell has also specify width. In this way I can wrap items to the next row by calculating width.
 
After that I would like to create an event on cell's click, which return me the Area value. But with this I think I wouldn't have a problem.
Grzesiek
Top achievements
Rank 2
Iron
 asked on 03 Apr 2012
2 answers
149 views
My app is a WPF application designed for use on a touch screen equipped laptop mounted in police cars.  Every control is larger in size and uses a larger font, just to make the application easy to read while driving and easy to interact with.

My main window has a RadTabControl in it.  In one tab I have a Search control I built.  This has a bunch of criteria fields at the top and a RadGridView on the bottom that displays all the rows returned from the datbase that matches the user's criteria.  This is fine and dandy.  Let's call this the Searcher control.

On another tab, I have a new control that I'm building.  This control contains a third party mapping control in it.  All of the data in the database is stamped with geographical coordinates and this new control needs to map each row returned on the map.  Let's call this the Map control.

To make this happen, the Searcher control contains a DependencyProperty called Reads.  This is an ObservableCollection of view model objects corresponding to the data returned by the search.  The Map control also has a DependencyProperty called Reads of the same type.  In the Xaml for my window, I bind the Map control's Reads property to the Searcher Control's Reads property using xaml like this:

<telerik:RadTabControl Name="OperationsTabs"
                SelectionChanged="Tabs_SelectionChanged"
                Visibility="Collapsed">
   
    <telerik:RadTabItem Header="  Search  "
                Name="SearchTab">
        <cs:Searcher Name="SearchControl" />
    </telerik:RadTabItem>
  
    <telerik:RadTabItem Header="Map Results"
                Name="MapResultsTab">
        <cs:MapResults Name="MapResults"
                 Reads="{Binding ElementName=SearchControl, Path=Reads}" />
    </telerik:RadTabItem>
</telerik:RadTabControl>

Here is some code that gets run when the value of the Reads DependencyProperty in the Map control changes:

public void OnReadsChanged( ObservableCollection<ReadViewModel> newValue ) {
    ReadsGrid.ItemsSource = newValue;
}
  
public static void OnReadsChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) {
    MapResults map = (MapResults) d;
    map.OnReadsChanged( (ObservableCollection<ReadViewModel>) e.NewValue );
}

I have seen the code in these methods run in the debugger, so I know that the assignment occurs.

I have added a SelectionChanged event handler to the RadGridView on the Searcher control. Here is what that event does:

private void ReadsGrid_SelectionChanged( object sender, SelectionChangeEventArgs e ) {
    if ( ProcessChange ) {
        MapResultsControl.ProcessChange = false;
        MapResultsControl.ReadsGrid.SelectedItem = ReadsGrid.SelectedItem as ReadViewModel;
        MapResultsControl.ProcessChange = true;
    }
    e.Handled = true;
}

I have also added a SelectionChanged event handler to the RadGridView on the Map control  Here is what that event does:

private void ReadsGrid_SelectionChanged( object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e ) {
    if ( ProcessChange ) {
        SearchControl.ProcessChange = false;
        SearchControl.ReadsGrid.SelectedItem = ReadsGrid.SelectedItem;
        SearchControl.ProcessChange = true;
    }
}

There is code in the MainWindow which assigns the appropriate object references to the MapResultsControl and SearchControl properties.

The idea behind this code is to make sure that the selected item in both RadGridViews stay in synch.  If you change it in one, it changes it in the other.  The ProcessChange flags are there to prevent an infinite recursion of one calling the other.

Now, this works, provided the Map control has been rendered before you try selecting a row in either control.  If you switch to the Map Results tab after finishing the search, the RadGridView is populated with data.  Then selecting a row in either control changes the SelectedItem in the other.

BUT if you select a row in the Searcher control's RadGridView BEFORE you display the Map Results tab, nothing gets selected in the other RadGridView.  This is because the Items property is empty if the RadGridView hasn't been rendered.  I know it is because I've stepped through the code in the debugger and I checked.

So how do I fix this?  What's a good work around for this scenario?

Tony
Tony
Top achievements
Rank 1
 answered on 03 Apr 2012
6 answers
115 views
Hello Telerik.

I am using the GridView and adding content to the HierarchyChildTemplate.  When I add the WebBrowser control I have issues with what appears to be Z order.  I have a Window which contains a RadDocking control.  Here I am using a RadPane extension to utilize an ItemsSource property to allow the dynamic use of RadPane controls.  In the UserControl which is contained in the dynamic RadPane, utilizing a factory pattern, I have the GridView with the HierarchyChildTemplate.  When I create a second RadPane and dock it below the the first the WebBroswer control is not confined to the space held by the HierarchyChildTemplate.  The WebBrowser control is laying over the newly created RadPane.

I thought this may have something to do with your architecture with the docking control when utilzing HTML content.  I did implement the work around described in this post http://www.telerik.com/community/forums/wpf/docking/wpf-frame-control-not-visible-in-floating-window.aspx.  I had the same exact problem in another Window.  However; the resolution here did not resolve the problem I described.  I was not certain if this problem was a result of the GridView or the RadDocking.  With this solution duplicated in my problem it would seem that the problem exists with the GridView and hierarchyChildTemplate and the fact it is in a RadDocking container has no tangible influence.

Could you describe how I can limit the WebBrowser to the HierarchyChildTemplate?

Thanks

Paul
Paul
Top achievements
Rank 1
 answered on 03 Apr 2012
2 answers
92 views
Hello,
I've developed a quite huge WPF application, with RadGridview's context menu representing the operation a user can do on a certain entity, now I've been asked to add the feature of allowing to show/remove columns for user personalization... I've tried on a mockup project the demo code on Telerik's demo -> RadGridView -> Header Context Menu ... this works fine if I've got a single context menu, if I've defined my own (the application has around 60 different context menu) the headermenu isn't shown... what can I do to have both living on my gridview?
I've tried following the code at 
http://www.telerik.com/help/silverlight/radcontextmenu-how-to-use-radcontextmenu-with-radgridview.html 

but it doesn't work fine with the demo implementation...any suggestion?
Thanks
Paolo
Michele
Top achievements
Rank 2
 answered on 03 Apr 2012
1 answer
146 views
I have disabled the context menu for a RadRichTextBox via Xaml like IsContextMenuEnabled="False".
Still a context menu is shown, it look's like a part of the ribbon to set font properties.
You can choose font, background and foreground color, bold, italic etc.
I would like to get rid of this context menu as wel, is this possible and so yes how?

Mike
Telerik team
 answered on 03 Apr 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
Book
FileDialogs
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
Rating
SplashScreen
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?