Telerik Forums
UI for WPF Forum
2 answers
643 views
Hello,

I have pretty much the same problem describe in that post : http://www.telerik.com/community/forums/wpf/gridview/rowdetailstemplate-and-text-wrapping.aspx .

Inside my RowDetails I have a control with some textblocs (set to warp). I dont want the horizontal scrollbar, to make my textblock warp.

The difference with the previous link is that I dont want to set the RadGridView width to a constant value. (to follow the window size)

I want the RowDetails width to be the same as the RadGridView width. I've set the ScrollViewer.HorizontalScrollBarVisibility= to "Disabled"

So I tried to bind the MaxWidth of my control inside the RowDetails value with RadGridView but it doesnt work (textblocs don't warp and horizontal scrollbar is still on)

this is my code :

<telerikGrid:RadGridView x:Name="MRUList" 
            ItemsSource="{Binding MRUSupplierItems, Mode=TwoWay}"  
            SelectedItem="{Binding CurrentSelectedSupplierItem, Mode=TwoWay}"
            Grid.Row="1" d:LayoutOverrides="Width" VerticalAlignment="Top"
            IsSynchronizedWithCurrentItem="True" 
            RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" IsFilteringAllowed="False"
            AutoGenerateColumns="False" CanUserInsertRows="False" RowDetailsVisibilityMode="Collapsed"
            IsReadOnly="True" CanUserDeleteRows="True"
            CanUserFreezeColumns="False" Margin="2,2,2,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
         >
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleBrandName, Source={StaticResource Resource}}" UniqueName="PriceList_Name" DataMemberBinding="{Binding PriceList_Name}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductRef, Source={StaticResource Resource}}" UniqueName="Reference" DataMemberBinding="{Binding Reference}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductName, Source={StaticResource Resource}}" Width="*" UniqueName="Name" DataMemberBinding="{Binding Name}" IsSortable="True" />
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductPrice, Source={StaticResource Resource}}" UniqueName="Price" DataMemberBinding="{Binding PublicPrice}" IsSortable="True" />
            </telerikGrid:RadGridView.Columns>
              
            <telerikGrid:RadGridView.RowDetailsTemplate>
                <DataTemplate x:Name="RowDetailsProvider">
                    <local:SupplierItemUserControl 
                        MaxWidth="{Binding Width, ElementName=MRUList}"
                        AddItemToQuotationCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToQuotationCommand, Mode=TwoWay}"
                        AddItemToCartCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToCartCommand, Mode=TwoWay}"
                        DisplayAddToCart="True"
                        DisplayAddToQuotation="{Binding IsCurrentQuotationAvailable, Mode=OneWay}"
                        DisplayRemoveFromCart="False"
                    />
                </DataTemplate>
            </telerikGrid:RadGridView.RowDetailsTemplate>
              
        </telerikGrid:RadGridView>

Thanks for your help!

Regards.
Jean
Top achievements
Rank 1
 answered on 05 May 2011
1 answer
127 views
Hello Telerik Team,

I have a RadOutlookBar, in which is currently one view that inherits from RadOutlookBarItem. In that view I overrided the OnIsSelectedChanged-Method from RadOutlookBarItem.
In the view, that contains the RadOutlookBar-Control, I added an eventhandler to the event PreviewSelectionChanged. So when I started the Application with the View, following methods are called:

1. OnIsSelectedChanged of the RadOutlookBarItem (oldvalue=false, newvalue=true)
2. The event PreviewSelectionChanged of the RadOutlookBar is fired (and certainly my eventhandler is called)

And if SelectionChangedEventArgs.Handled is set to true
3. OnIsSelectedChanged of the RadOutlookBarItem(oldvalue=true, newvalue=false)

Why is OnIsSelectedChanged called before the PreviewSelectionChanged-Event is fired?

Further Question:
If I click on the unselected OutlookBarItem, at first PreviewSelectionChanged from OutlookBar ist fired, if the Handled-Property is set to true, the OnIsSelectedChanged-Method of the Item ist called twice (first time with newValue = false, the second time with newValue = true)

Why is the OnIsSelectedChanged-Method called twice?
Hristo
Telerik team
 answered on 05 May 2011
1 answer
61 views

Hi,

We are currently implementing automated UI testing and would like to know if there has been any progress on the automation support for the RadTreeListView in the upcoming May 12th release.  Please reference http://www.telerik.com/community/forums/wpf/treelist/radtreelistview-automation-testing.aspx for any additional information.

Thanks,

Greg

Yordanka
Telerik team
 answered on 05 May 2011
8 answers
210 views
Hello.

We have a bug that's arisen with a couple of GridViews. In each row, we have a number of columns. One of these columns, let's call it Column X, has a CellStyle that contains a DataTrigger to start a storyboarded animation for a cell's colour based on it's contents. Clearly, this animation is only meant to occur on cells in this particular column, but unfortunately, when the GridView is scrolled horizontally, the colour animation begins to play on cells in other columns in the row. Output from Snoop seems to suggest that the defined CellStyle on Column X is being erroneously retained somewhere and used as a default style for cells in other columns as they are dynamically created and destroyed, or perhaps reused, during the scrolling. The fact that the animation only starts on other columns when Column X is scrolled out of view seems to support this.

I have attempted to fix it by setting normal CellStyles on all of our other columns, but this hasn't alleviated the problem.

Is this an issue that has been observed before? Is there a solution, or perhaps some more steps that I can take to try to fix it?

Thanks,
- Chris M.
ChrisM
Top achievements
Rank 1
 answered on 05 May 2011
1 answer
117 views
I'm creating a windows explorer-like application using a treeview control. When a user double clicks a treeview item, it reloads the treeview with the new directory and its subfolders and files. Works fine. 

I tried to add a progress bar to it and have it update using the backgroundworker object, like this msdn example:
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

using this code for the mouse double click event of the treeview items:
private void tvDirectory_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
 
    RadTreeViewItem item = (RadTreeViewItem)((RadTreeView)sender).SelectedContainer;
    string arg = item.Header.ToString();
    
    wrkDeploy.RunWorkerAsync(arg);
 
}

and this for the background worker eventhandlers:
  BackgroundWorker wrkDeploy;
public MainWindow()
        {
            InitializeComponent();
            this.wrkDeploy = new BackgroundWorker();
            wrkDeploy.RunWorkerCompleted += new RunWorkerCompletedEventHandler(wrkDeploy_RunWorkerCompleted);
            wrkDeploy.DoWork += new DoWorkEventHandler(wrkDeploy_DoWork);
            wrkDeploy.ProgressChanged += new ProgressChangedEventHandler(wrkDeploy_ProgressChanged);
        }
 
  private void wrkDeploy_DoWork(object sender, DoWorkEventArgs e)
        {
            string item = e.Argument.ToString();
            if (isDirectory(_currentPath + item.ToString()))
            {
 
                _currentPath += @"\";
                DirectoryInfo di = new DirectoryInfo(_currentPath);
                DirectoryInfo[] directories = null;
                int cnt = 0;
                int maxCnt = 0;
                try
                {
                    directories = di.GetDirectories();
                    FileInfo[] files = di.GetFiles();
                    maxCnt = directories.Length + files.Length;
                    while (cnt < maxCnt)
                    {
 

 
                        foreach (DirectoryInfo dInfo in directories)
                        {
 
                            RadTreeViewItem tvDirectoryItem = new RadTreeViewItem() { Header = dInfo.Name, DefaultImageSrc = "folder_icon.gif", ItemsOptionListType = OptionListType.OptionList, OptionType = OptionListType.None };
                            tvDirectory.Items.Add(tvDirectoryItem);
                            cnt += 1;
                            int percentComplete = (cnt / maxCnt) * 100;
                            wrkDeploy.ReportProgress(percentComplete);
                        }
                        if (files.Length > 0 && cnt == 0)
                        {
 
                            RadTreeViewItem root = new RadTreeViewItem() { Header = "Select/Deselect All Files in Folder" };
                            root.Checked += new System.EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_itemChecked);
                            root.Unchecked += new System.EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_itemUnChecked);
                            tvDirectory.Items.Add(root);
                        }
 
                        foreach (FileInfo fInfo in files)
                        {
 
                            RadTreeViewItem tvFileItem = new RadTreeViewItem() { Header = fInfo.Name, ItemsOptionListType = OptionListType.CheckList, OptionType = OptionListType.CheckList };
                            tvFileItem.Checked += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_fileChecked);
                            tvFileItem.Unchecked += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_fileUnChecked);
                            tvDirectory.Items.Add(tvFileItem);
                            cnt += 1;
                            int percentComplete = (cnt / maxCnt) * 100;
                            wrkDeploy.ReportProgress(percentComplete);
                        }
                    }
                }
                catch (UnauthorizedAccessException uae) { }
            }
        }
        private void wrkDeploy_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {

        }
        private void wrkDeploy_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            this.ProgressBar1.Value = (double)e.ProgressPercentage;
        }

I get an error stating "The calling thread must be STA, because many UI components require this." when I run it on the line that instantiates the first treeview item in my do work event handler
"RadTreeViewItem tvDirectoryItem = new RadTreeViewItem() { Header = dInfo.Name, DefaultImageSrc = "folder_icon.gif", ItemsOptionListType = OptionListType.OptionList, OptionType = OptionListType.None };"

Help please, thanks.
Hristo
Telerik team
 answered on 05 May 2011
1 answer
192 views
Hi,
I am using telerik gridview in wpf application.I am dynamically created telerik gridview using C#.I want to merge column header ie I want to show each column header under two subheaders through programatically using c#.
Maya
Telerik team
 answered on 05 May 2011
2 answers
106 views
RadGridView shows a white button in the grid. I am using version 2011.1.0419.
is there any way to remove the button from the grid.
Ankit
Top achievements
Rank 1
 answered on 05 May 2011
3 answers
93 views
Hi all,
   I get this really nice error message "Locating source for 'c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\DragDrop\DragProviders\WPFSimulatedDragDropProvider.cs'"
in my test project for WPF and OpenAccess, when I drag a column header to the "Drag a column header and drop it here to group by that column" but only if the column I drag doesn't contain string data.
I'm using VS2010 and Telerik 2011 Q1 controls, columns in the RadGridview are autogenerated.

Any thoughts ?

Yours
   Bjössi
Tsvyatko
Telerik team
 answered on 05 May 2011
2 answers
287 views
Hi,

If user scroll the grid to certain row, how can I get the first row in the visible area in grid, also last row in grid if possible?

Thanks
tzuhsun
Top achievements
Rank 1
 answered on 05 May 2011
4 answers
137 views
Hi,

The SimpleFiltering example binds the visibility of a data series to a view model via XAML, eg.:
<telerik:DataSeries
    LegendLabel="EU-27">
    <telerik:DataSeries.Definition>
        <telerik:LineSeriesDefinition
            ItemLabelFormat="0.#"
            Visibility="{Binding Source={StaticResource ViewModel}, Path=SeriesEU27Visibility}" />
    </telerik:DataSeries.Definition>

How can I achieve the same functionality via code (I'm coding in Visual Basic)? I'm buidling my data series dynamically through code, however I haven't able to figure out how to bind the visibility property via code.

Kind regards,
Dave.
David
Top achievements
Rank 2
 answered on 05 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?