Telerik Forums
UI for WPF Forum
7 answers
179 views
I'm frustrated with the tree column for the GanttView as well as Cell templates within all columns.

I'd like to have the tree column be un-frozen, not necessarily be the first visible column, and not necessarily be bound to title.

I tried changing the MemberBinding of the TreeColumnDefinition to point to a different property but it still seems to go after the Title property. I tried adding a Cell Template similar to this:

<telerik:TreeColumnDefinition MemberBinding="{Binding WBS}" Header="WBS" ColumnWidth="60">
  <telerik:TreeColumnDefinition.CellTemplate>
    <DataTemplate>
      <TextBlock Text="{Binding WBS}" />
    </DataTemplate>
  </telerik:TreeColumnDefinition.CellTemplate>
</telerik:TreeColumnDefinition>

But that binding was invalid. Not being able to access my data item from within a DataTemplate is a pretty bad thing in my opinion and a severe limitation of the control in its current form.

I don't like that the TreeColumn is frozen and leftmost and would like to be able to change this behavior. The frozen isn't as bad as the leftmost behavior. 

Is there any way in the current code to have the TreeColumn point at something other than Title? How do I get at my data item from within a DataTemplate? The data context doesn't appear to be correct.
Miroslav Nedyalkov
Telerik team
 answered on 04 Dec 2012
6 answers
167 views
Hello,

We are using Telerik RadControls for WPF Q3 2010. We have a RadGridView in which the user can edit the data displayed. The edit control for string columns is RadMaskedTextBox.

When I want to enter a @ character with AltGr+v using Hungarian keyboard layout, it seems a 'weird' paste operation (Ctrl+v) occurs: when the clipboard contains multi-line text, new rows are inserted in the grid, when single-line, nothing happens.

Also the AltGr+c (which is a & for hu-HU) wont work. Other key combinations which I've tested works fine.

I can reproduce this issue using the RadControls for WPF Demo -> GridView -> First Look example (where the cells are editable).

Thanks,
   Zoltan Tanczos
Josip
Top achievements
Rank 1
 answered on 04 Dec 2012
4 answers
235 views
Hi,

I use an Image that is shown when dragging:
args.DragVisual = new ContentControl { Content = MyImage, Width = 25, Height = 25 };
This image always shows up at a certain position relative to the cursor. Can I influence this position? I tried DragVisualOffset but - maybe I used it incorrect - that didn't result in a change of position. Thanks in advance, Vincent
Vincent
Top achievements
Rank 1
 answered on 04 Dec 2012
0 answers
171 views
Hi,

I've recently begun working on my first WPF application using Telerik's RadControls and I've run into a problem which I am unable to solve. I have a main RadGridView which has multiple levels of nested RadGridViews (3 nested gridviews in total). Each nested GridView relies on information from the parent in order to populate the columns and I do so by binding a method to the LoadingRowDetails event and pass that information to my ViewModel. When the nested gridview attempts to load the ObservableCollection, its Get method uses the retrieved information in order to execute an SQL query on the DB and populate the collection. 

My problem is that for some reason when I attempt to bind a method to the 3rd nested RadGridView, instead of working as the parents do, it throws an NullReferenceException (it doesn't even reach the method) upon attempting to expand just the first row.
I've read and searched everywhere for a solution, but to no avail.

I unfortunately cannot share my actual code, since my company prohibits it, but I hope this example is clear enough to perhaps allow for a solution.

<Grid>   
    <telerik:RadGridView x:Name="Tools" Marin="0" LoadingRowDetails="ToolsLoadingRowDetails" ItemsSource="{Binding Tools}" IsReadOnly="True" RowHeight="45" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserResizeColumns="True" ShowGroupPanel="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewToggleRowDetailsColumn />
            <telerik:GridViewDataColumn Header="Product Id" DataMemberBinding="{Binding Path=TypeOfTool}" Width="*"/>
            <telerik:GridViewDataColumn Header="Target market" DataMemberBinding="{Binding Path=TargetMarket}" Width="3*"/>
           </telerik:RadGridView.Columns>
           <telerik:RadGridView:RowDetailsTemplate>
               <DataTemplate>
                   <telerik:RadGridView  Marin="0" LoadingRowDetails="MoreInfoLoadingRowDetails" ItemsSource="{Binding Path=DataContext.MoreInfo, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" IsReadOnly="True" RowHeight="45" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserResizeColumns="True" ShowGroupPanel="False">
                       <telerik:RadGridView.Columns>
                           <telerik:GridViewToggleRowDetailsColumn />
                           <telerik:GridViewDataColumn Header="More Info" DataMemberBinding="{Binding Path=MoreInfo}" Width="*"/>
                       </telerik:RadGridView.Columns>
                          <DataTemplate>
                               <telerik:RadGridView Marin="0" LoadingRowDetails="DetailedInfoLoadingRowDetails" ItemsSource="{Binding Path=DataContext.DetailedInfo, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}, AncestorLevel=2}}" IsReadOnly="True" RowHeight="45" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserResizeColumns="True" ShowGroupPanel="False">
                                   <telerik:RadGridView.Columns>
                                       <telerik:GridViewToggleRowDetailsColumn />
                                      <telerik:GridViewDataColumn Header="Detailed Info" DataMemberBinding="{Binding Path=DetailedInfo}" Width="*"/>
                                   </telerik:RadGridView.Columns>
                                       <DataTemplate>
                                           <telerik:RadGridView Marin="0" LoadingRowDetails="TargetInfoLoadingRowDetails" ItemsSource="{Binding Path=DataContext.TargetInfo, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}, AncestorLevel=3}}" IsReadOnly="True" RowHeight="45" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserResizeColumns="True" ShowGroupPanel="False">
                                               <telerik:RadGridView.Columns>
                                                  <telerik:GridViewToggleRowDetailsColumn />
                                                  <telerik:GridViewDataColumn Header="Target Info" DataMemberBinding="{Binding Path=TargetInfo}" Width="*"/>
                                   </telerik:RadGridView.Columns>
                               </telerik:RadGridView>
                           </telerik:RadGridView.RowDetailsTemplate>
                       </telerik:RadGridView>
                   </DataTemplate>
               </telerik:RadGridView.RowDetailsTemplate>
           </telerik:RadGridView>
       </DataTemplate>
   </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>

Again, I just wrote this by hand so it probably contains open/close tagging errors, but the overall idea should be understood.
The problematic event to bind to is the deepest one, in the example it is the "TargetInfo" GridView. 
The XAML works as long as I don't bind to the LoadingRowDetails event. The moment I add the binding, the code throws the NullReferenceException
open attempt to expand the first row.

I hope I've provided enough information regarding the problem.

Thanks

Dave
Top achievements
Rank 1
 asked on 03 Dec 2012
6 answers
120 views
HI,

Is there a way to keep either ends of the itemsource (first and last item) as top item in the caouselpanel whenever I reached the first/last item when scrolling..

Thanks,
Jog
Jonah
Top achievements
Rank 1
 answered on 03 Dec 2012
3 answers
277 views

Hello,

I am using CellTemplateSelector to change the color of a cell depending on its value.  I found sample code on how to do this and it works well for GridViewDataColumn but I can't get it to work with GridViewExpressionColumn

 
I'm using the following and it works:


<
telerik:GridViewDataColumn DataMemberBinding= "{Binding TotalAdjRateNew}" TextAlignment="Right" Width="100" DataFormatString="{} {0:#%}" IsReadOnly="True">

    <telerik:GridViewDataColumn.Header>

        <TextBlock Text="New Total Adj %" TextWrapping="NoWrap" TextAlignment="Center" />

    </telerik:GridViewDataColumn.Header>

    <telerik:GridViewDataColumn.CellTemplateSelector>

        <telerik:ConditionalDataTemplateSelector>

            <telerik:DataTemplateRule Condition="TotalAdjRateNew &lt; 0">

                <DataTemplate>

                    <TextBlock Text="{Binding TotalAdjRateNew, StringFormat=p0}" 
                        HorizontalAlignment
="Right" Foreground="Red"/>

                </DataTemplate>

            </telerik:DataTemplateRule>
        </telerik:ConditionalDataTemplateSelector>

    </telerik:GridViewDataColumn.CellTemplateSelector>

</telerik:GridViewDataColumn>

 

However when I use the code below with a GridViewExpressionColumn  the value is not displaying.  I am not sure what the binding should be inside the DataTemplateRule.

 

<telerik:GridViewExpressionColumn UniqueName="TotalAdjPCT" TextAlignment="Right" Width="100" 
    DataFormatString
="{} {0:#%}" Expression="MAN_ADJ_PCT + MOD_ADJ_PCT" IsReadOnly="True">

     <telerik:GridViewExpressionColumn.Header>

        <TextBlock Text="Total Adj %" TextWrapping="NoWrap" TextAlignment="Center" />

    </telerik:GridViewExpressionColumn.Header>

    <telerik:GridViewExpressionColumn.CellTemplateSelector>

        <telerik:ConditionalDataTemplateSelector>

            <telerik:DataTemplateRule Condition="MAN_ADJ_PCT + MOD_ADJ_PCT &lt; 0">

                <DataTemplate>

                    <TextBlock Text="{Binding TotalAdjPCT, StringFormat=p0}" HorizontalAlignment="Right" 
                        Foreground
="Red"/>

                </DataTemplate>

            </telerik:DataTemplateRule>

        </telerik:ConditionalDataTemplateSelector>

    </telerik:GridViewExpressionColumn.CellTemplateSelector>

</telerik:GridViewExpressionColumn>

 

Yoan
Telerik team
 answered on 03 Dec 2012
14 answers
382 views
Hi everybody!

I want to provide the possibility to select multiple rows, columns and cells like in Excel. That means I need a combination of row and cell selection. Are there any demos are examples how to achieve this?

If I have to implement it myself, an event that is fired when a row or column header cell is clicked would be helpful. Does it exist?

Thanks

Uli

Alan
Top achievements
Rank 2
 answered on 03 Dec 2012
1 answer
101 views
We use several radGridViews in our project and have often included an export button to push the content of the grids to Excel. Our users love the feature.

Recently we discovered a problem when you have a combobox column.  It seems to be trying to convert the display string to the type of the column during the export.  It's difficult to explain so I have prepared a small demo of the problem:

https://www.dropbox.com/s/4zkr5ofgmyfbgtt/radGridViewErrorTest.zip

if you try to export the data it will throw an error saying that the 'String must be exactly one character long'.  For combo boxes that use an integer as the selected value instead of a char (like this example does) the message will ready 'Input string not in correct format'.

Is there a better way to do combo box columns or the export so that this error can be avoided?
Yoan
Telerik team
 answered on 03 Dec 2012
0 answers
94 views
Hi
RadPaneGroup.Items.Refresh();

when I use this code in my wpf project all of RadDocumentPane is closed.
whats the basic concept of using RadPaneGroup and RadDocumentPane?
Ahad
Top achievements
Rank 1
 asked on 03 Dec 2012
10 answers
410 views
I'm trying to build a page using the DataForm ICollectionVew Synchronization demo as an example - having a GridView and a DataForm bound to the same CollectionView.

My underlying data is an ObservableCollection of my own record objects, which are instances of a class that implements INotifyPropertyChanged and IEditableObject. This collection is populated from a database.

In my VIewModel, I construct a QueryableCollectionView from the ObservableCollection, and I bind both the GridView and the DataForm to this.  Everything seems to work fine, as I navigate through the records, both on the form and in the grid.  Changing the selected record in the form changes the selected record in the grid, and vice versa.

If I edit a record in the form, the changes appear immediately in the grid, and if I hit cancel in the form, they immediately revert to what they were, in the grid.  (Which indicates that the ICollectionView.EditCancel is working right).

I have a CollectionChanged handler listening for changes in the QueryableCollectionView.  When I click on Delete, it sees a NotifyCollectionChangedAction.Remove, and deletes the record from the database.  And this seems to be working fine.

When I click "Add", I see a new row in the GridView, blank fields in the DataForm, and the CollectionChanged handler sees a NotifyCollectionChangedAction.Add, and is passed an empty instance of the record.  All it does then is populate the fields in the record that aren't visible in the GridView or the DataForm.  Later, when the user hit's the "OK" button on the DataForm, the ICollectionView.EditEnd method on the record is called - which does an insert or an update to put the record into the database.

And here's where things go wrong.  The new row in the GridView stays highlighted, like the grid thinks it's still being edited.  And while if I navigate to next and previous records in the DataForm, I see the selected row in the grid changing, if I change the selected row in the grid, I do not see the DataForm updated with the newly-selected record.

Something is not quite right, and I'm at a loss as to where to look.

Any ideas?
Maya
Telerik team
 answered on 03 Dec 2012
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?