Telerik Forums
UI for WPF Forum
1 answer
66 views
hi all
i add several text to an list<run> and assign radbook itemssource to it.
several of my text is biggest page and dont show.
how can i show that text?
can wrap text in next page or add an scroll to scroll page?
thankful.
Tina Stancheva
Telerik team
 answered on 25 May 2011
1 answer
133 views
hi all
i have 2 xml file and an treeview and an flowdocumentscrollviewer when i select an item from treeview its text in xml read and show in flowdocumentscrollviewer .

first xml file:
<books Name="a" >
    <book Name="" Index="1" Media="1.mp3">
        
    </book>
    <book Name="b" Index="2" Media="2.mp3">
         
    </book>
</books>

second xml file:
<text>
  <mainText>
     text1
  </mainText>
  <mainText>
   text2
  </mainText>
  </text>

i want replace flowdocumentscrollviewer with an book interface.
how can do this?
thankful.
Tina Stancheva
Telerik team
 answered on 25 May 2011
6 answers
110 views
I have a grid with the HorizontalAlignment set to left so that I get a nice compact grid.  When the grid is first loaded with data, the columns auto-size to properly fit the contents.  When the grid is first loaded, the IsFilteringAllowed is set to false and it is bound to a ViewModel for this property.

IsFilteringAllowed="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.IsAdvancedUserInterfaceOn}"

We have allowed the user the ability to toggle this on and off.  When the user toggles it to true.  The columns properly resize to fit the filter indicator for each column.

However when the user toggles this off, setting the toggle to false, the indicator disappears, but the columns retain their size.  Here's a screenshot describing the issue.

I looked but I don't see a method to call to resize the columns back to their original size.  Can you help?
Rossen Hristov
Telerik team
 answered on 25 May 2011
10 answers
1.3K+ views

I using radGridView containing two columns, one is of a plain text type and the other one is of a Rich Text (RadRichTextBox).

In order to implement it, I’ve set the grid column’s CellTemplate property (as shown in the following code).

Inside the cell, the data is being shown correctly. But the cell is being drawn with large margins (which become more noticeable when the row is selected or is the current row).
(Screenshot -
http://imageshack.us/photo/my-images/864/radgriditemcontainersty.gif/ )

When clicking on those margins the cell’s content disappears.

What do I need to do in order to eliminate the cell margin?

Code:

<Window x:Class="GridTesting.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

        xmlns:telerikProvider="clr-namespace:Telerik.Windows.Documents.FormatProviders.Html;assembly=Telerik.Windows.Documents.FormatProviders.Html"

        Title="MainWindow" Height="350" Width="780" x:Name="GridTesting"

        >

    <Grid>

        <telerik:RadGridView

                                 CanUserReorderColumns="True" ReorderColumnsMode="ReorderColumns"

                                 RowIndicatorVisibility="Visible" SelectionMode="Extended" ShowGroupPanel="False"

                                 CanUserInsertRows="True" ShowInsertRow="False" CanUserDeleteRows="True" DragElementAction="None"

                                 ItemsSource="{Binding ItemsSource, ElementName=GridTesting}" AutoGenerateColumns="False">

            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn Header="Name" Width="2*" >

                    <telerik:GridViewDataColumn.CellTemplate>

                        <DataTemplate>

                            <StackPanel>

                                <TextBox Text="{Binding Name, Mode=TwoWay}"

                                         HorizontalAlignment="Stretch" VerticalAlignment="Stretch" TextWrapping="Wrap"

                                                             BorderThickness="0" Padding="0" Margin="0" MaxHeight="100"/>

                            </StackPanel>

                        </DataTemplate>

                    </telerik:GridViewDataColumn.CellTemplate>

                </telerik:GridViewDataColumn>

                <telerik:GridViewDataColumn Header="Description" Width="5*">

                    <telerik:GridViewDataColumn.CellTemplate>

                        <DataTemplate>

                            <StackPanel>

                                <telerik:RadRichTextBox x:Name="DescriptionRichTextBox" AcceptsTab="False" MaxHeight="100" BorderThickness="0" IsSpellCheckingEnabled="False" />

                                <telerikProvider:HtmlDataProvider RichTextBox="{Binding ElementName=DescriptionRichTextBox}" Html="{Binding Description, Mode=TwoWay}" />

                            </StackPanel>

                        </DataTemplate>

                    </telerik:GridViewDataColumn.CellTemplate>

                </telerik:GridViewDataColumn>

            </telerik:RadGridView.Columns>

        </telerik:RadGridView>

    </Grid>

</Window>

(I also tried to change the ItemContainerStyle, but without success)

Rotem
Top achievements
Rank 1
 answered on 25 May 2011
1 answer
226 views

Hi Telerik,

I'm working with RadControls for WPF Q1 2011 and PRISM 4 - MVVM. I need to add a view into a floating window programmatically. The goal is when my main window displayed, a floating window (another view) will also be displayed. The MVVM module will pass the view into the floating window, hence I need to define a region within the window. Is it possible to achieve and how?

Thank you,
Agung

George
Telerik team
 answered on 25 May 2011
2 answers
102 views
How can globalize the text inside of

RadColorSelector

"Automatic", "Theme colors", "Standard colors..." etc...

Thanks in advance.
Fernando
Top achievements
Rank 1
 answered on 25 May 2011
4 answers
385 views
Hi

I Want to know how can I bind a single DataGrid with Multiple ObervableCollections with each ObervableCollection having different element Type.

Regards
.
Ivan Ivanov
Telerik team
 answered on 25 May 2011
1 answer
77 views
If FakePopup is meant to be a kind of Adorner that holds floating windows, I'm guessing it is being sized to fit the entire desktop. My normal setup is a laptop with a 1280x800 display and two external monitors with 1680x1050 each. When my desktop is extended to one external monitor it works, but when it is extended across both, the exception occurs in FakePopup.Open(). Any orientation of any two displays works, but a third display always results in the exception. The integrated video makes use of system RAM, but it is not anywhere near being taxed. I have 4gb (effectively 2.9 for 32 bit XP).

Can you reproduce this? Is it something that can be fixed? More and more users are starting to have multi-monitor setups.
Miroslav Nedyalkov
Telerik team
 answered on 25 May 2011
1 answer
567 views
Hi !
We are using RADGrid for displaying a set of products. and We are using WPF and MVVM as framework.

I have following scenario :

I need to sort a grid on two columns - for example Product type and Product Name.
Consider following as a collection

ProductType         ProductName
1                            Product 1
1                            Product 2
3                            Product 5
2                            Product 3

So we need to do sort first on Product Type and secondly on name.

I have did following:
Following is my xaml :

<

 

 

telerik:RadGridView x:Name="gvProductData"

 

 

 

 

Grid.Row="1"

 

 

 

 

ShowGroupPanel="False"

 

 

 

 

IsFilteringAllowed="False"

 

 

 

ScrollViewer.VerticalScrollBarVisibility="Auto"

 

 

 

ScrollViewer.HorizontalScrollBarVisibility="Auto"

 

 

 

 

ItemsSource="{Binding FilteredProducts, Mode=TwoWay}"

 

 

 

 

IsReadOnly="True" AutoGenerateColumns="False"

 

 

 

BorderThickness="0"

 

 

 

HorizontalAlignment="Left"

 

 

 

SelectedItem="{Binding SelectedProduct, Mode=TwoWay}"

 

 

 

Visibility="{Binding GridViewVisibility}"

 

 

 

>

 

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn Header="Quick Code" DataMemberBinding="{Binding ProductType}" Width="100" TextWrapping="Wrap" />

 

 

 

 

 

 

 

 

<telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding ProductName}" Width="*" TextWrapping="Wrap"/>
</telerik:RadGridView.Columns>

 

 

 

 

 

<i:Interaction.Triggers>

 

 

 

 

<i:EventTrigger EventName="Sorting">

 

 

 

 

<cmd:EventToCommand Command="{Binding Path=OnGridSortCommand}" PassEventArgsToCommand="True">

 

 

 

 

</cmd:EventToCommand>

 

 

 

 

</i:EventTrigger>

 

 

 

 

</i:Interaction.Triggers>

 

 

 

 

</telerik:RadGridView >


Following is my View Model :

 

 

private

 

 

void OnGridSortClicked(RoutedEventArgs e)

 

 

{

 

 

 

 

IEnumerable<CustomModelProductSelection> qry = from p in this.Products

 

 

 

 

 

orderby p.FavoriteAsEnum, p.ProductDescription

 

 

 

 

 

select p;

 

 

FilteredProducts =

 

 

new List<CustomModelProductSelection>(qry);

 

 

}

 

 

 

 

So here in my view model I can get the column header on which user clicked for sorting from RoutedEventArgs parameter. But ideally i shall not be doing it as it violates the MVVM pattern (ViewModel should not have tightly coupled with view)

Do you know any other way to get the sort column name from grid? like maintaining the header collection and binding to grid..

Thanks!
Dharmesh

Ivan Ivanov
Telerik team
 answered on 25 May 2011
7 answers
424 views
Hi

When entering a date by hand and NOT tabbing/clicking somewhere outside of the RadDatePicker the SelectedDate is not written down to de DataContext. I know this is a usual behavior in WPF and I have a workaround for the TextBox in form of checking the focused element, getting the bindingexpression and updating it before saving my object. 
But this doesn't work for the picker as the focused item is a TextBox and not the picker itself and therefore the bindingexpression doesn't exists on this control. How can I achieve the same result?

My code so far:
   BindingExpression BindingExpr = null
            if (Keyboard.FocusedElement is TextBox) 
            { 
                BindingExpr = (Keyboard.FocusedElement as TextBox).GetBindingExpression(TextBox.TextProperty); 
 
                if (BindingExpr != null
                { 
                    BindingExpr.UpdateSource(); 
                } 
            } 

Thanks for response/advice!
Yana
Telerik team
 answered on 25 May 2011
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?