Telerik Forums
UI for WPF Forum
2 answers
95 views
Hi,

I've been looking through the DataGrid documentation (the WPF Demos, looking at the code behind) and there is a CellTemplateSelector property used:

<telerik:GridViewDataColumn Header="UnitPrice" DataMemberBinding="{Binding UnitPrice}" 
                            CellTemplateSelector="{StaticResource selector}" DataFormatString="{}{0:c}" /> 
(Demo: Controls -> Data -> GridView -> DataTemplateSelectors -> Templating cells -> example.xaml)

Im using the RadControls for WPF Q1 2010 SP2, however this property does not appear, I can set the property CellTemplate property but not a CellTemplateSelector. Should this be possible?

<telerik:GridViewDataColumn UniqueName="direction"   
                            Header="Direction" DataMemberBinding="{Binding Path=eventDirection}"/> 

Thank you,
Toby
Top achievements
Rank 1
 answered on 25 Jun 2010
1 answer
66 views

Hi,

i have tried following thing for Stick chart. Following thing is worling fine now issue:

public partial class MainPage : UserControl  
    {  
        public MainPage()  
        {  
            InitializeComponent();  
 
            InitializeChart();  
        }  
 
        private void InitializeChart()  
        {  
            Telerik.Windows.Controls.Charting.StickSeriesDefinition cssd = new StickSeriesDefinition();  
            cssd.ShowItemToolTips = true;             
 
 
            telerikChart.DefaultSeriesDefinition = cssd;  
            telerikChart.ItemsSource = GetStocks();  
            SeriesMapping sm=new SeriesMapping();  
            sm.ItemMappings.Add(new ItemMapping("Name", DataPointMember.XCategory));  
            sm.ItemMappings.Add(new ItemMapping("Open",DataPointMember.Open));  
            sm.ItemMappings.Add(new ItemMapping("Close", DataPointMember.Close));  
            sm.ItemMappings.Add(new ItemMapping("Low", DataPointMember.Low));  
            sm.ItemMappings.Add(new ItemMapping("High", DataPointMember.High));  
            sm.ItemMappings.Add(new ItemMapping("High", DataPointMember.Tooltip));  
              
 
            telerikChart.SeriesMappings.Add(sm);  
            telerikChart.DefaultSeriesDefinition.ShowItemLabels = true;  
        }  
 
        private List<Stock> GetStocks()  
        {  
            List<Stock> lstStock = new List<Stock>();  
 
            for (int i = 0; i < 1000; i=i+100)  
            {  
                Stock s = new Stock();  
                s.Name = "Stock" + i;  
                s.Open = i + 100;  
                s.Low = i;  
                Random r = new Random(i);  
                r.NextDouble();  
                s.Close = r.Next(100,150) + i;  
                s.High = s.Close + i;  
                lstStock.Add(s);  
            }  
 
            return lstStock;  
        }  
 
          
 
    }  
 
    public class Stock  
    {  
 
        public string Name { getset; }  
        public double Open { getset; }  
        public double Close { getset; }  
        public double High { getset; }  
        public double Low { getset; }  
 
    } 

Stick chart is also shown (Plz See attachment).

Issue:

I have set telerikChart.DefaultSeriesDefinition.ShowItemLabels = true;  
so that to see the Item Label, but stick chart is showing 0 as highlighted in the screenshot. Is there way to see open,Close,Low.high value of the stick as a item label?


Can you please provide me good sample for the same. also provide pointer to doc that explains the Stick chart.

Ves
Telerik team
 answered on 25 Jun 2010
1 answer
634 views
Hello,

Is it possible to prevent drag operation when an user is using a GridSplitter to resize column/row ?

For example :



        <telerik:RadTreeView IsDragDropEnabled="True" ItemTemplate="{StaticResource TreeItemTemplate}">  
            <telerik:RadTreeView.ItemContainerStyle> 
                <Style TargetType="{x:Type telerik:RadTreeViewItem}">  
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>  
                </Style> 
            </telerik:RadTreeView.ItemContainerStyle> 
            <telerik:RadTreeView.Items> 
                <Control Name="control1" Tag="Some text for control1" /> 
                <Control Name="control2" Tag="Some text for control2" /> 
            </telerik:RadTreeView.Items> 
        </telerik:RadTreeView> 
 
            <DataTemplate x:Key="TreeItemTemplate">  
                <Border BorderThickness="1" BorderBrush="LightGray" Margin="2" CornerRadius="5">  
                    <Grid> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto"/>  
                            <ColumnDefinition Width="*"/>  
                        </Grid.ColumnDefinitions> 
                        <TextBlock Grid.Column="0" Text="{Binding Name}" Margin="3,0,10,0"/>  
                        <GridSplitter Grid.Column="0" Width="1" Background="LightGray" ResizeDirection="Columns"/>  
                        <TextBlock Grid.Column="1" Text="{Binding Tag}" Margin="3,0,0,0"/>  
                    </Grid> 
                </Border> 
            </DataTemplate> 
 

Is there any solution ? I tried t define  dragDrop:RadDragAndDropManager.AllowDrag="False" on GridSplitter but this doesn't work.

I have the same problem using RadDragDropManager in a templated list (Some draggable items contain Slider).

Thanks,
Guillaume.
GuillaumeR
Top achievements
Rank 1
 answered on 25 Jun 2010
3 answers
583 views
I've done some searching, but I didn't see this issue anywhere.  Please forgive me if I'm duplicating.  There are two issues but they appear related.

Issue #1

I have a RadOutlookBar that is bound to a list of items.  Each of the items contains a list which is bound to a grid.  The grid is in a template that defines the RadOutlookBar's content.  Everything binds fine, but when I select a different RadOutlookBarItem, the grid refreshes, and will throw an exception:

Invalid property or field - '[FieldName]' for type: Object  


In this case, it only happens for one field, and only if I specify the DataFormatString. 

DataFormatString="{}{0:dd/MM/yyyy}" 

As you can see, this field is DateTime type.  If I step through the exceptions, the field will load properly.

Issue #2

This issue is very similar to the above.  We have a RadTabControl that is bound to a list.  The list items also contain lists which are bound to a template that contains a grid.  In this case, the items are different types and so the grids themselves are defined in different DataTemplates targeting their specific DataTypes.  Initially, everything loads just fine, but when you select a different tab, an exception with the same message as issue #1 will be thrown for each column that was defined in the originally selected tab.  This time though, the type is the type of item listed in the newly selected tab's grid.

Invalid property or field - '[FieldName from previous]' for type: [Row data type for selected] 

Again, after stepping through the exceptions, the grid loads just fine.

One tip for reproducing the exceptions if they are not being caught (the code is just throwing exceptions away):
Go to Debug -> Exceptions.. 
Tick the "Thrown" checkbox next to "Common Language Runtime Exceptions".




Vlad
Telerik team
 answered on 25 Jun 2010
1 answer
119 views
Hi,

    When open too many tabs in the docking area, the tabs tend to be very small and hard to find, is there any method to create a button at coner and when clicked  it opens a drop down list of all opened tabs?
 

bingwei
Top achievements
Rank 1
 answered on 25 Jun 2010
2 answers
104 views

Hi there,

I just like my Drop working if the target is inside the same ListBoxItem, not across ListBoxItem.

For instatnce, I put the the telerik's FirstLook example(aa1:eample) in ListBox:
<ListBox Grid.Row="1">
<ListBoxItem Height="250"> <aa1:Example></aa1:Example></ListBoxItem>

<ListBoxItem> <aa1:Example></aa1:Example>
</ListBoxItem>

</ListBox>

The control will show 2 times, I can drag from ListBoxItem1 and drop to ListBoxItem2.  What I need is drag from ListBoxItem1 and drop the other side of ListBoxItem1, avoid dropping to different ListBoxItem. Is any way to fix that?

Thanks!

Amy

Amy
Top achievements
Rank 1
 answered on 24 Jun 2010
3 answers
102 views

I'm using endless scrolling.  (based on this code: "Endless scrolling of 2mil. records" that is updated for Q2010 here: http://www.telerik.com/ClientsFiles/159249_wpfapplication1.zip)

The problem is I can't get data from selected row. I see the data in debugger (var row = radGrid.SelectedItem;) but don't know How to get.

I can change the "QueryableCollectionView" from:
orderby s.artist, s.title 
select new { s.artist, s.title, s.id}); 


to:
orderby s.artist, s.title 
select s); 


Then I can get my class from Datacontex, but then the grid scroll to top evrytime it fill ut with new data, and I don't like that...






f__AnonymousType
Vlad
Telerik team
 answered on 24 Jun 2010
2 answers
63 views
Hi there,

We are using the GridViewComboBoxColumn to display a set of times available for the user to pick from in a given day of the week.

The client would like to choose from values like "0759", "1700", "1130", etc.  Basically it's just a 4 digit text value.  Because of their screen size requirements we need to make the column width as small as possible.

The problem I'm having is that when the user attempts to edit the column, when the cell changes to a Textbox with the arrow, the last digit gets clipped.  This poses a problem because the user likes to Tab through the cells making changes and they cannot see the true value because the last digit is clipped.

You can see an example in this screenshot.

it appears like there is plenty of room next to the arrow pointing down, but there appears to be some excessive left-padding on that arrow that is overlapping the text.

Is there anyway I can adjust this?
Rick Glos
Top achievements
Rank 1
 answered on 24 Jun 2010
5 answers
111 views
the itemsource for gridview is binded to WCF.
The WCF returns data in descending order, but the gridview takes only last 50rows and shows them in descending order.

How to increase the no of rows displayed?

Milan
Telerik team
 answered on 24 Jun 2010
1 answer
143 views
Hi, I'm working on a grid that has a footer that is the sum of each column. That same Footer need to calculate the difference between these two columns. Can someone help me? 

Thanks, Alexandre.
Pavel Pavlov
Telerik team
 answered on 24 Jun 2010
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
Slider
Expander
TileList
PersistenceFramework
DataPager
TimeBar
Styling
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
CardView
DataBar
WebCam
FilePathPicker
Licensing
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? 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?