Telerik Forums
UI for WPF Forum
3 answers
278 views
Hello,

I got some issues with setting a Value in an Object depending on the Selection in a GridViewComboBoxColumn.

I have a List of Objects bound to a RadGridView. An Object contains a List of valid Value-Objects for a Value-Property the Object has. What I want to do is now bind the List of valid Value-Objects to the ComboBoxes of the Column ( each Object has a different List of valid Value-Objects) and set the Value-Property of the referring Object depending on the SelectedItem in the ComboBox.

Object ()
{
string Name {get; set;}
int Number {get;set;}
List<Value> ValidValues;
Value Value {get; set;}
bool Visibility {get;set;}
}

Value()
{
string Description {get;set;}
string Key {get;private set;}
}

<telerik:RadGridView ItemsSource="{Binding Objects}" AutoGenerateColumns="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Header="Nr." DataMemberBinding="{Binding Number}" IsReadOnly="True">
                            </telerik:GridViewDataColumn>
                            <telerik:GridViewDataColumn Header="Name" IsReadOnly="True" DataMemberBinding="{Binding Name}">
                            </telerik:GridViewDataColumn>
                            <telerik:GridViewCheckBoxColumn Header="Visibility" IsReadOnly="True" DataMemberBinding="{Binding IsVisible}">
                            </telerik:GridViewCheckBoxColumn>
                            <telerik:GridViewComboBoxColumn Header="Value"
                                                            Width="250"
                                                            ItemsSourceBinding="{Binding ValidValues}"
                                                            DisplayMemberPath="Description"
                                                            IsComboBoxEditable="False"
                                                            DataMemberBinding="{Binding Key}"
                                                            SelectedValueMemberPath="Key" // I have to set that to Key because otherwise the Combobox is not showing anything when the respective row is not more on focus //
                                                            >
                            </telerik:GridViewComboBoxColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>

I hope this is enough code to understand what my problem is and offer me some help if possible. Thank you!
Regards,
Achim
Dimitrina
Telerik team
 answered on 05 May 2014
1 answer
265 views
I've implemented a hierarchical GridView with RadGridView in WPF and bound it MVVM style to an ObservableCollection of some custom object A which expose a child property which again is another ObservableCollection of some other type B.  It binds correctly and for the most part behaves correctly (virtualization doesn't work) but it is including a varying amount of blank vertical space between the top level rows which seems to correlate to some degree with the number of rows in the child GridView.

Seems like the GridView is just not able to correctly measure and size the vertical space necessary to accommodate the rows.

I've tried setting a fixed height on the container element which is a grid, setting the rowheight, the visiblerowheight, disable vertical scrolling - nothing seems to make a difference.

Desperate for a solution. Getting ready to throw in the towel and write my own regular ol' hierarchical data grid.

Any ideas?

Vera
Telerik team
 answered on 05 May 2014
3 answers
301 views
I have an application which is using RadMap to display Bing data which works very nice. The application also uses a map tool created by ThinkGeo to load and display shape files distributed by them called the World Map Kit. The ThinkGeo tool is fine, however the Telerik one is much better and nicer to work with. As such I attempted to load the shape files into the RadMap tool and was unable to because of the extreme slowdown of the application.

One shape file which appears to outline all land features took about a minute to load and then an additional minute or so after the ReadCompleted event to finally let the layer display. Another shape file is taking several minutes to load with no signs of stopping. Panning or zooming is also painfully slow.

ThinkGeo is able to load and display their map with about 30 or so seconds of total loading.

One key difference I can see is the largest shape file in the RadMap example is world_continents with a size of 185K. The largest ThinkGeo shape file is 384 MB with a DBF size of 285 MB. Can RadMap work with very large shape files?

Update: I went to check the version I was using which was 2010.3.1314.40. I upgraded to 2011.1.411.40 and now it fails loading any shape file with the error "Width and Height must be non-negative" and attempts to find the source for InformationLayer.ArrangeOverride line 695. In the 2010 version these shape files loaded, but were quite slow.
Peshito
Telerik team
 answered on 05 May 2014
1 answer
142 views
Is it possible to bind SelectedItems on the VisualizationLayer?
Andrey
Telerik team
 answered on 05 May 2014
2 answers
212 views
I have a RadGridView hosted with a RadPane.  The GridView uses a row style to highlight those rows where "IsSelected" is true however whenever any panes are added to the RadPaneGroup or the docking of any Pane (including the pane with the GridView) is changed, all of the "Selected" checkboxes are set to False and the formatting is lost.

Selecting another record from the master grid then selecting the original record resets the formatting.

The following defines the DocumentHost, RadPaneGroups and RadPanes;

<telerik:RadDocking Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Name="rdContent"
    Margin="5,2"
    MaxWidth="5000"
    MaxHeight="5000"
    telerik:StyleManager.Theme="Office_Blue">
     
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer x:Name="rcsContent" InitialPosition="DockedLeft">
            <telerik:RadPaneGroup x:Name="rpgContent">
                <telerik:RadPane x:Name="rpProcesses" Header="Well Processes">
                    <telerik:RadGridView Name="gvProcesses" RowStyle="{StaticResource SelectedGrid}"
                        Margin="5,2"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        telerik:StyleManager.Theme="Office_Blue"
                        AutoGenerateColumns="False"
                        ShowColumnFooters="False"
                        ShowGroupFooters="False"
                        ShowGroupPanel="False"
                        RowIndicatorVisibility="Collapsed"
                        ItemsSource="{Binding}"
                        DataLoadMode="Synchronous"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        ToolTip="Select the Processes associated with the Well Stage record"
                        UseLayoutRounding="True"
                        Visibility="Visible"
                        MinHeight="100"
                        MaxHeight="250">
 
                        <telerik:RadGridView.Resources>
                            <Style TargetType="ListBox">
                                <Setter Property="MaxHeight" Value="400" />
                            </Style>
                        </telerik:RadGridView.Resources>
 
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewCheckBoxColumn Header="Active" UniqueName="IsActive" DataMemberBinding="{Binding Path=IsActive}" IsReadOnly="True" Width="auto" TextAlignment="Center">
                                <telerik:GridViewCheckBoxColumn.CellStyle>
                                    <Style TargetType="telerik:GridViewCell">
                                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                                    </Style>
                                </telerik:GridViewCheckBoxColumn.CellStyle>
                            </telerik:GridViewCheckBoxColumn>
 
                            <telerik:GridViewDataColumn Header="Select" UniqueName="Selected" DataMemberBinding="{Binding Path=IsSelected}" IsReadOnly="False" Width="auto">
                                <telerik:GridViewDataColumn.CellStyle>
                                    <Style TargetType="telerik:GridViewCell">
                                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                                    </Style>
                                </telerik:GridViewDataColumn.CellStyle>
 
                                <!-- See http://www.telerik.com/help/wpf/gridview-checkbox-column-clicks.html for info on enabling single-click editing of checkboxes -->
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding Path=IsSelected, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" telerik:StyleManager.Theme="Office_Blue" Click="Process_Clicked" />
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
 
                            <telerik:GridViewDataColumn Header="Process" UniqueName="Process" DataMemberBinding="{Binding Path=Process}" IsReadOnly="True" Width="auto" />
 
                            <telerik:GridViewDataColumn Header="Notes" UniqueName="Notes" IsReadOnly="True" Width="*">
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Path=Notes, Converter={StaticResource RemoveNewLine}}" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis" />
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadPane>
                 
                <telerik:RadPane x:Name="rpRigClasses" Header="Rig Classes">
                    <telerik:RadGridView Name="gvRigClasses" RowStyle="{StaticResource SelectedGrid}"
                        Margin="5,2"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        telerik:StyleManager.Theme="Office_Blue"
                        AutoGenerateColumns="False"
                        ShowColumnFooters="False"
                        ShowGroupFooters="False"
                        ShowGroupPanel="False"
                        RowIndicatorVisibility="Collapsed"
                        ItemsSource="{Binding}"
                        DataLoadMode="Synchronous"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        ToolTip="Select a Project record to edit"
                        UseLayoutRounding="True"
                        Visibility="Visible"
                        MinHeight="100"
                        MaxHeight="250">
 
                        <telerik:RadGridView.Resources>
                            <Style TargetType="ListBox">
                                <Setter Property="MaxHeight" Value="400" />
                            </Style>
                        </telerik:RadGridView.Resources>
 
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewCheckBoxColumn Header="Active" UniqueName="IsActive" DataMemberBinding="{Binding Path=IsActive}" IsReadOnly="True" Width="auto" TextAlignment="Center">
                                <telerik:GridViewCheckBoxColumn.CellStyle>
                                    <Style TargetType="telerik:GridViewCell">
                                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                                    </Style>
                                </telerik:GridViewCheckBoxColumn.CellStyle>
                            </telerik:GridViewCheckBoxColumn>
 
                            <telerik:GridViewDataColumn Header="Select" UniqueName="Selected" DataMemberBinding="{Binding Path=IsSelected}" IsReadOnly="False" Width="auto">
                                <telerik:GridViewDataColumn.CellStyle>
                                    <Style TargetType="telerik:GridViewCell">
                                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                                    </Style>
                                </telerik:GridViewDataColumn.CellStyle>
 
                                <!-- See http://www.telerik.com/help/wpf/gridview-checkbox-column-clicks.html for info on enabling single-click editing of checkboxes -->
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding Path=IsSelected, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" telerik:StyleManager.Theme="Office_Blue" Click="RigClass_Clicked" />
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
 
                            <telerik:GridViewDataColumn Header="Rig Class" UniqueName="RigClass" DataMemberBinding="{Binding Path=RigClass}" IsReadOnly="True" Width="auto" />
 
                            <telerik:GridViewDataColumn Header="Notes" UniqueName="Notes" IsReadOnly="True" Width="*">
                                <telerik:GridViewDataColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Path=Notes, Converter={StaticResource RemoveNewLine}}" HorizontalAlignment="Left" TextTrimming="CharacterEllipsis" />
                                    </DataTemplate>
                                </telerik:GridViewDataColumn.CellTemplate>
                            </telerik:GridViewDataColumn>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

The attached shows;
  1. The initial display when a record is loaded.
  2. The screen after docking to the right.
  3. The screen after re-selecting the record.

The grid is bound to an ObservableCollection so I'm not sure why the "Selected" values would change.

Does anyone have any suggestions?

Raymond
Top achievements
Rank 1
 answered on 04 May 2014
1 answer
143 views
Hello,

I'm working on a framework that is supposed to provide improvements to WPF controls. This framework also provides features for Telerik controls.

I would like to make a behavior that bring an item of a TreeView into view when it is (programmatically) selected.
The problem is, on the layer I'm working on, I have no idea of the path of the object to bring into the view (Because I don't know the associated view model). Basically I have the following method to implement in the behavior:

protected override void BringIntoView(object dataItem)
{
    // TODO: bring dataItem into the view of the AssociatedObject treeview
}


All I know is that dataItem is an item of the treeview. It can be collapsed and have no associated TreeViewItem yet. As far as I understand, under this situation I have to use the BringPathIntoView.

It is not a problem if I have to iterate through the whole graph of items, but I have to find the path of the item that was passed to this method. I can get the value of the TextSearch.TextPathProperty attached to the tree view, which can help me to construct the path of each item.

But how can I iterate through the children of a given item, since the children collection is defined by the HierarchicalDataTemplate used by the TreeViewItem that might be unrealized?

Thanks
Martin Ivanov
Telerik team
 answered on 02 May 2014
3 answers
383 views
Hi,
i am sending the email to ask for help about the RadRichTextBox. Therefore, my problem is that when we add the page number in document, this is written in white on the document.  How to write in black? 
I would like to know if you have some advice related to my problem.
Best regards,
Petya
Telerik team
 answered on 02 May 2014
3 answers
452 views

Hello

We need to update the source when property changed,

The source object update only when the cell edit ended.

Is there way to do this?

Best regards

Ehud

Dimitrina
Telerik team
 answered on 02 May 2014
2 answers
102 views
Is there a way to control the label connectors through binding or otherwise? It seems the datacontext for the connector is the same bound object as the chart and not the point. (RadCartesianChart) I'd like to selectively hide labels with a datatemplate but the connectors remain.

Petar Marchev
Telerik team
 answered on 02 May 2014
5 answers
550 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
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
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?