Telerik Forums
UI for WPF Forum
4 answers
269 views
Here's my situation:

  1. an MVVM pattern is used on the client
  2. the View has a readonly RadGridView with sorting and paging through the RadDataPager
  3. the ViewModel has a Repository, wrapping an EntityFramework ObjectContext


What is the best way to integrate the RadGridView/RadDataPager  with this Repository?

I have been looking at QueryableCollectionView, but found myself wondering:
- how do the sort and filter parameters get translated into the object context query?
- how does the page information gets passed into an object context query?

Do I need to take care of all these things myself?
Or is there a better integration, so that the Telerik components involved know
how to deal with an IQueryable<T> and do all the paging, sorting, filtering?

Thanks for your time,
Koen
Vlad
Telerik team
 answered on 20 Sep 2012
0 answers
117 views
The GridView is binding to a collectionview from the viewmodel:
 ItemsSource="{Binding Path=dataitemscv, NotifyOnSourceUpdated=True}"

which dataitemscv is a ICollectionView

I have checked dataitemscv is updated.

The collectionchanged event did fire with action as reset

I have tried to Refresh() the collectionview in viewmodel

I have tried to Rebind the GridView in code behind

nothing will update the UI, any suggestions?
Neogeo
Top achievements
Rank 1
 asked on 20 Sep 2012
3 answers
159 views
Considering this code: 
<telerik:RadGridView ItemsSource="{Binding SearchResults}" RowDetailsVisibilityMode="VisibleWhenSelected">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding FirstName}"  />
        <telerik:GridViewDataColumn Header="Last Name" DataMemberBinding="{Binding LastName}"  />
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.RowDetailsTemplate>
        <DataTemplate>
            <Button Command="{Binding OpenView1Command}">Open View 1</Button> <!-- This does not work -->
        </DataTemplate>
    </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>


The OpenView1Command is defined in my ViewModel. How do I make the binding work? 
Sergiy
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
176 views
I need to save docking layout into a file when the application is closing and retrieve the layout at start-up.  I tried to learn it from the Docking Serialization example, my application calls OnSave on Window_Closed event and copy the stream into a file.  Since most of modules in the application are discovered by Prism and added into the RadDocking via Prism's RegionManager at start-up, so I am not sure when should I call OnLoad function to load the layout from the file.  Could you please help.  .

Another question: what different between Isolated Storage vs Save in a Stream?

Thanks!
Tina Stancheva
Telerik team
 answered on 19 Sep 2012
0 answers
86 views
Hi,
I use template selector because i have different objects. Everything is fine except adding new item(NewItemTemplate = null, why?).
If I click "New" button, dataform doesnt show any fields. Why dataform doesnt use in this case EditTemplate or why it doesnt have NewItemTemplateSelector as Property?

Thanks! 
Dmitrijs
Top achievements
Rank 1
 asked on 19 Sep 2012
2 answers
1.6K+ views
Hi..
I have the following ComboBox using a data template.. I'm trying to set the default value to a selection.
When the page loads the selection is blank.
I've tried 


  // BIND
  var queryConf = from c in DC.conferences
                            orderby c.name descending
                            select c;
                        
        this.cmbConf.ItemsSource = queryConf.ToList();

// Set DEFAULT
  this.cmbConf.SelectedItem = queryConf.ToList()[1];
   this.cmbConf.Text = (queryConf.ToList()[1] as conference).name;

but the selection is still blank. !!!

I have also tried

this.cmbConf.SelectedIndex = 1;


How can I set the default value and show the values? 
What am I doing wrong.
thx again


 ///  COMBOBOX

    <telerikInput:RadComboBox  TabIndex="6"  Name="cmbConf" telerik:TextSearch.TextPath="name" 
                                 FontWeight="Bold" telerikControls:StyleManager.Theme="Vista"
                                 SelectedValue="{Binding Path=id}"  SelectedValuePath="id" Width="332" >
                    
                        <telerikInput:RadComboBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="5" Width="300">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <TextBlock FontWeight="Bold" FontSize="14" x:Name="txtConf"  Text="{Binding name}" />
                                    <TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Text="{Binding name_alt}" />


                                    <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,0,0">


                                        <TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding first_day, StringFormat=d}" />
                                        <TextBlock Foreground="Navy" Margin="5,0,0,0" Text=" - " />
                                        <TextBlock Foreground="Navy" Margin="5,0,0,0" Text="{Binding last_day, StringFormat=d}" />


                                    </StackPanel>


                                </Grid>
                            </DataTemplate>
                        </telerikInput:RadComboBox.ItemTemplate>
                    </telerikInput:RadComboBox>
Jon
Top achievements
Rank 1
 answered on 19 Sep 2012
0 answers
106 views
hi ,

I am having a scenario where i want to add hyperlinks within Richtextbox dynamically from code .I want a specific tool tip as well for each hyperlinkinfo.Since there is only navigateuri property through which we can assign some key info , there is no other way to customize the tool tip information so that tool tip informtaion can be different.

I have already checked hyperlinktooltipformatstring  which will only change the navigationuri position inside the tooltip through placeholders.The basic intention is to set navigationuri some information which can be primarykey sort of text which can be processed in hyperlinkclicked event and some meaningful information as tool tip information that is different from navigationuri.

for eg: navigationuri can be some guid ( "e7c784da-a6c7-4b84-bf1c-8e2b93b9e7ab" ) and tool tip like " click to go to screen 1".
Any help appreciated in advance.

thanks
satheesh
Zatzh
Top achievements
Rank 1
 asked on 19 Sep 2012
4 answers
1.4K+ views
I am getting this when I copy the Busy Indicator example

The calling thread must be STA, because many UI components require this.

Does anyone have any ideas
Sandi Markon
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
507 views
Hi all,

we have problems with the RadDocking Control.
Any RadPane's in the xaml file are declared as Hidden.
After Start my Program, you can click on the textblock control in Left Pane
for showing 2 Top Panes. When i click on the Pane 2 showing 3 additional Panes on Bottom.
The Program crashed when i click often on any Bottom Pane.

Here is my code:

XAML
<Window x:Class="DockingTest.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadDocking Name="RadDocking" ActivePaneChanged="RadDocking_ActivePaneChanged">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup Name="RadPaneGroup_Top">
                        <telerik:RadPane Header="Informationen zur Analyse" Name="RadPane_Informationen" IsHidden="True">
                            <telerik:RadPane.Content>
                                <Grid>
                                    <TextBlock Text="Here is a Text in Pane Top #1"/>
                                </Grid>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                        <telerik:RadPane Header="Teilbauwerke" Name="RadPane_Teilbauwerke" IsHidden="True">
                            <telerik:RadPane.Content>
                                <Grid>
                                    <TextBlock Text="Here is a Text in Pane Top #2"/>
                                </Grid>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="250,150" MaxWidth="600" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Übersicht Analysen" CanUserClose="False">
                        <Grid>
                            <TextBlock Text="Here is a Text in Pane Left... Click to Show Top Panes." TextWrapping="Wrap" MouseDown="TextBlock_MouseDown"/>
                        </Grid>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer Name="RadSplitContainer_Bottom" telerik:DockingPanel.InitialSize="400, 250" InitialPosition="DockedBottom" Orientation="Horizontal" HorizontalAlignment="Stretch">
                <telerik:RadPaneGroup HorizontalAlignment="Stretch" Name="RadPaneGroup_Bottom" >
                    <telerik:RadPane Header="Grundinformationen" Name="RadPane_Teilbauwerk_Pane1" IsHidden="True" IsSelected="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #1"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane #2" x:Name="RadPane_Teilbauwerk_Pane2" IsHidden="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #2"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane #3" Name="RadPane_Teilbauwerk_Pane3" IsHidden="True">
                        <telerik:RadPane.Content>
                            <Grid>
                                <TextBlock Text="Here is a Text in Pane #3"/>
                            </Grid>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>

Code behind:

private void RadDocking_ActivePaneChanged(object sender, Telerik.Windows.Controls.Docking.ActivePangeChangedEventArgs e)
{
    if (this.RadDocking.ActivePane.Header.ToString() == "Teilbauwerke")
    {
        this.RadPane_Teilbauwerk_Pane1.IsHidden = false;
        this.RadPane_Teilbauwerk_Pane2.IsHidden = false;
        this.RadPane_Teilbauwerk_Pane3.IsHidden = false;
 
    }
    else
    {
        this.RadPane_Teilbauwerk_Pane1.IsHidden = true;
        this.RadPane_Teilbauwerk_Pane2.IsHidden = true;
        this.RadPane_Teilbauwerk_Pane3.IsHidden = true;
    }
}
 
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
{
    this.RadPane_Teilbauwerk_Pane1.IsHidden = true;
    this.RadPane_Teilbauwerk_Pane2.IsHidden = true;
    this.RadPane_Teilbauwerk_Pane3.IsHidden = true;
 
    this.RadPane_Informationen.IsHidden = false;
    this.RadPane_Teilbauwerke.IsHidden = false;
 
 
    this.RadPane_Informationen.IsSelected = true;
}

Thanks for helping.
Armin
Top achievements
Rank 1
 answered on 19 Sep 2012
1 answer
99 views
Hi Team,

When ever i used grid column width as * , the width of the next column value is changing dynamically based on the content of * width Column. But the same code working nicely in RibbonBar and  Normal Window. But when the same code paste in Ribbon View BackstageItem the designing is disturbing. Please look at the below code snippet and help me.

  <Grid DataContext="{StaticResource ViewModel}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="11"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="7"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                    <RowDefinition Height="7"></RowDefinition>
                                    <RowDefinition Height="auto"></RowDefinition>
                                    <RowDefinition Height="11"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="11"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition> ( if  Width="1000' , it is working superb..)
                                    <ColumnDefinition Width="7"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="7"></ColumnDefinition>
                                    <ColumnDefinition Width="auto"></ColumnDefinition>
                                    <ColumnDefinition Width="11"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                
                                <ItemsControl Name="lstLocations" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="5"  ItemsSource="{Binding _lstLevels}">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Button Margin="10" Name="btnLevel" Command="{Binding GetRoomsbyLevelCommand,Source={StaticResource ViewModel}}" CommandParameter="{Binding Path=Tag,ElementName=btnLevel}" Tag="{Binding}" MinHeight="80" MinWidth="80" Content="{Binding Name}"/>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <telerik:RadWrapPanel />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>


                                <Border Background="LightGray" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="5" CornerRadius="10">
                                <ItemsControl Name="lstRooms" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="5" ItemsSource="{Binding lstRooms,Mode=TwoWay}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Button Margin="25,10,0,10" Background="{Binding RoomClass.Color,Converter={StaticResource ColorConverter}}" Name="btnRooms" Height="50" Width="50" Content="{Binding Name}"/>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel HorizontalAlignment="Left"></WrapPanel>
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                    </ItemsControl>
                                </Border>


                                <Border Background="Gray" CornerRadius="10"  Grid.Row="5" Grid.Column="1">
                                    <ItemsControl Name="lstRoomsClass"  ItemsSource="{Binding _lstRoomClass}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Button Margin="25,10,0,10" Name="btnRoomClass"  Background="{Binding Color,Converter={StaticResource ColorConverter}}" Command="{Binding CreateRoomsInLevelCommand,Source={StaticResource ViewModel}}" CommandParameter="{Binding Path=Tag,ElementName=btnRoomClass}" Tag="{Binding}" Height="50" Width="50" Content="{Binding Name}"/>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <WrapPanel Orientation="Horizontal" HorizontalAlignment="Left"></WrapPanel>
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                    </ItemsControl>
                                </Border>

                                <Button IsDefault="True" Content="OK" Grid.Row="5" Grid.Column="3" Height="80" Width="80"  Name="btnAddRooms"  Command="{Binding SaveFirmDataCommand}"    />

                                <Button  Content="Cancel" Grid.Row="5" Grid.Column="5" Height="80" Width="80"  Name="btnCancelRooms" />

                            </Grid> 

Thanks, 
Srinivas.
Tina Stancheva
Telerik team
 answered on 19 Sep 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?