Telerik Forums
UI for WPF Forum
1 answer
522 views

Good day,

I am using RadGridView control using 2009 Q2 version of Telerik. And i have the following problem.

I am using bindings for having some control on some behavior into the Grid. My idea is, binding the column to a property, set unable and disable the checkbox we have in the column. For that i use RelativeSource FindAncestor

<telerik:GridViewDataColumn UniqueName="List" IsFilterable="False" Width="100">
    <telerik:GridViewColumn.HeaderCellStyle>
        <Style TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:GridViewHeaderCell">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="Edit" HorizontalAlignment="Center"></TextBlock>
                            <CheckBox x:Name="AllEdited" HorizontalAlignment="Center" VerticalAlignment="Center" Click="AllEdited_Click" Validation.ErrorTemplate="{x:Null}" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=DataContext.EditMode}"></CheckBox>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:GridViewColumn.HeaderCellStyle>
    <telerik:GridViewColumn.CellStyle>
        <Style TargetType="telerikGridView:GridViewCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerikGridView:GridViewCell">
                        <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding CuestionarioVisible}" Validation.ErrorTemplate="{x:Null}" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=DataContext.EditMode}"></CheckBox>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:GridViewColumn.CellStyle>
</telerik:GridViewDataColumn>

As you can see in the code, I have binding on "IsEnabled" property for allowing or not to check on the checkboxes which was edited or not.
The binding works great in the header but, it ignores in the cell!

Any ideas? Why is that happening? Any solution for making the cells work in the same way as the header?

Thanks in advance.

Regards,
Alvaro
Alvaro
Top achievements
Rank 1
 answered on 24 Jan 2011
7 answers
233 views
Hello!

I can't find any obvious documentation about my specific use case, so please help me along here:

I have a class such as this:

    public class ProductPrognosis
    {
        public string PartNumber { get; set; }
        public Dictionary<DateTime, int> Prognosis { get; set; }
    }

This class gets filled with data extracted from an Excel document.
I then have a list of these objects that I use as my ItemsSource on a chart control:

<telerik:RadChart  ItemsSource="{Binding Prognoses}" Grid.Row="1" Margin="4,0" Background="#66ffffff" />

My problem is, I cannot find a way to tell RadChart how to get at the series in the collection..
I would have expected some properties, such as SeriesNameProperty and SeriesDataProperty that when defined made RadChart auto-create series based on the set of data presented..

Looking at the samples you have published, I only see manual definition of series using quite verbose XML. And I fear that is not an acceptable solution. WPF UIs are meant to be data driven, not tersely defined in XAML.

I hope someone can solve this with a simple solution, I would hate to have to create a whole suite of magical tools that generate irrelevant objects (to me) on the fly..

Regards, Morten
Evgenia
Telerik team
 answered on 24 Jan 2011
1 answer
118 views
hey guys,

I'm experiencing a problem with Drag And Drop within my RadTreeView...  This worked fine under 2010 Q3, just since installing the SP1 I am getting this bug.. the code from the RadTreeView is below.... 

the error i'm receving is..

"An exception of type 'System.InvalidOperationException' occurred in Telerik.Windows.Controls.dll but was not handled in user code

Additional information: Root AdornerLayer Not Found. Please make sure that your root visual is Window or other element that has an adorner layer. Alternatively, wrap your root panel in an <AdornerDecorator> element."

further info...

"Error. Root AdornerLayer Not Found. Please make sure that your root visual element is window or other element that has an adorner layer alternatively wrap your root panel in an <AdornerDecorator> element.

When attempting to drag an element..

<DockPanel LastChildFill="True">
<telerikNavigation:RadTreeView x:Name="uiActivitiesList" IsDragDropEnabled="True" Margin="-20,0,0,0"
BorderThickness="0" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" TextDropAfter="Drop After" TextDropBefore="Drop Before"
SelectionChanged="uiActivitiesList_SelectionChanged" SelectionMode="Multiple" dragDrop:RadDragAndDropManager.AllowDrop="True" IsDragPreviewEnabled="False"
IsDragTooltipEnabled="True" DragEnded="uiActivitiesList_DragEnded" SourceUpdated="uiActivitiesList_SourceUpdated"
ItemsSource="{Binding ActivityModelViewCollection, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True,Mode=OneWay}"/>
</DockPanel>


I'm unsure if this is a bug or if i just need to wrap my user control in an AdornerDecorator, but some further information would be great.
http://eeuauaughhhuauaahh.ytmnd.com/
Tsvyatko
Telerik team
 answered on 24 Jan 2011
2 answers
121 views
Hi,
     I am using MVVM pattern. I have a telrik gridview and i want to capture its CellLostFocus event,for that i am using CellEditEnded event. But problem is that this event is firing when i am tabbing out of the cell,not on lost focus of the cell. Is there any way to capture CellLostFocus event of gridview. Since I am using MVVM pattern so I also dont want to write any code in code behind.

Thanks
apoorv
Top achievements
Rank 1
 answered on 24 Jan 2011
1 answer
319 views
Hi,
Is it possible to remove a RadPane from a RadDocking, instead of hiding it?
Ideally, I'd like to wire up the Close so that it removes the "closed" pane from the control.  Is this possible?

Thanks.
George
Telerik team
 answered on 24 Jan 2011
0 answers
162 views
How to make a custom shape of progressbar?For example,change the shape of progressbar from rectangle to triangle.
Best regards.
xjgs_xhj@163.com
Top achievements
Rank 1
 asked on 24 Jan 2011
1 answer
106 views
Hi,
just recently started evaluating your products. The demo page is excellent, but i ran into an error of some sort.
On the wpf demos i was trying out the GridView -> Performance -> Client binding to 1 mil. records, i get an error when i start scrolling the data by using the scrollbar slider. It doesn't go to an error if i use either the page down area or the arrows.

I'm using IE 8

-Matti
Vlad
Telerik team
 answered on 24 Jan 2011
1 answer
109 views
Hi,

Is is possible to used a custom sort order to perform a column sort in a GridView column?

For example,  I want to use a custom sort to sort text column row values 1,2,10,3 to have a sort order of 1,2,3,10 rather then 1,10,2,3

Thanks
Daniel
Vlad
Telerik team
 answered on 24 Jan 2011
5 answers
163 views
I want to change the datatemplate of the DragCue (I mean i want to change the image source of the image tag applied in datatemplate in XAML). I used the following event but it didn't help me out. please help ASAP.

      private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            cue = new ContentControl();
            e.QueryResult = true;
            cue.MouseUp += new MouseButtonEventHandler(cue_MouseUp);
           
            e.Options.DragCue = cue;

            ImageSource IMGSOURCE = new BitmapImage(new Uri("/Images/header_idea.png",UriKind.Relative));

            DataTemplate dt = new DataTemplate();
          
            FrameworkElementFactory ef = new FrameworkElementFactory(typeof(Image));
            ef.SetValue(Image.SourceProperty, IMGSOURCE);

            dt.VisualTree = ef;
            cue.ContentTemplate = dt;
                        
            e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();
            e.Handled = true;
        }
Tsvyatko
Telerik team
 answered on 21 Jan 2011
1 answer
92 views

hello admin,
                i have pasted the OnDragQuery event of the drag and drop. the two lines of code in which i have given the datatemplate to the drag cue's content template is is fine enough. But the image source in the datatemplate in xaml is always static  and i' not able to bind the image source. So, instead of that i wanted to give the dragcue a new image in C#. It does work, but its not firing and triggering the mouse up event. please point out any mistake and please suggest anything new if this isn't the right way to do it. And please i don't want to use the binding, as it is not working properply. Suggest something in DEeail. In DETAIL please, or attach and perfect and suitable example..Thanks in advance. please its important

 

 

void OnDragQuery(object sender, DragDropQueryEventArgs e)
{
ContentControl dragCue = new ContentControl();
e.QueryResult =
true;
dragCue.MouseUp += new MouseButtonEventHandler(dragCue_MouseUp);

dragCue.ContentTemplate =
this.Resources["DragTemplate"] as DataTemplate;  //is fine,
e.Options.DragCue = dragCue;   // but has static image souce in xaml

 

 

 

//Image im = new Image();             //this commented code doesn't fire
//im.Width = 40;                     //the MouseUp event, when i        
//im.Height = 40;                     //don't give the     
//im.Source = new BitmapImage(new Uri(@"/Images/drive.png", UriKind.Relative));  //content template to it. want
//e.Options.DragCue = im;             // to use it to give dynamic image
                                     //source instead 
                                    // of above highlighted code.

e.Options.ArrowCue =
RadDragAndDropManager.GenerateArrowCue();
e.Handled =
true;

 

}

 

 

Tsvyatko
Telerik team
 answered on 21 Jan 2011
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
DataPager
PersistenceFramework
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?