Hi!
I need use a different image from data base, i will asign the image(PNG) in order of an specific process.
The images recovered from data base are created in a temporal folder in order to use them in the dynamic process when i need chage the image.
At this moment the asignation of an image is ok but i can not see the image in the button:
RadRibbonButton objArea = new RadRibbonButton();
objArea.LargeImage = new BitmapImage(new Uri(auxPath + (string)dt.Rows[i].ItemArray[1], UriKind.Relative));
objArea.Size = Telerik.Windows.Controls.RibbonView.ButtonSize.Large;
If i use a RadRibbonButton created manually in xaml, i can change the image and the result is ok.
//control created in xaml
btnExample.LargeImage = new BitmapImage(new Uri(auxPath + (string)dt.Rows[i].ItemArray[1]));
If you help me i will be greateful.

Hi,
i'm looking for help with removing lines/border from column where i have hierarchical tree.
Property GridLinesVisibility is not solution because removes/adds lines in whole grid, but i want remove only in my first column.
I created styles based on GridviewCellStyle and applied them to cells, but without any results. RadTreeListView shows or not lanes only according to GridLinesVisibility, my styles changes nothing.
<Window.Resources> <Style x:Key="CellWithoutLanes" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}"> <Setter Property="BorderThickness" Value="0" /> </Style> <Style x:Key="CellWithLanes" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}"> <Setter Property="BorderBrush" Value="Black"/> <Setter Property="BorderThickness" Value="5,5,5,5" /> </Style> </Window.Resources> <Grid> <telerik:RadTreeListView ItemsSource="{Binding Processes}" AutoGenerateColumns="False" TreeLinesVisibility="Visible" RowIndicatorVisibility="Collapsed"> <telerik:RadTreeListView.ChildTableDefinitions> <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" /> </telerik:RadTreeListView.ChildTableDefinitions> <telerik:RadTreeListView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Element" CellStyle="{StaticResource ResourceKey=CellWithoutLanes}"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" Text="{Binding Id}"/> <TextBlock Grid.Column="1" Text="{Binding Name}"/> </Grid> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Id" CellStyle="{StaticResource ResourceKey=CellWithLanes}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Expression}" Header="Expression" CellStyle="{StaticResource ResourceKey=CellWithLanes}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding UserPriority}" Header="UserPriority" CellStyle="{StaticResource ResourceKey=CellWithLanes}" /> </telerik:RadTreeListView.Columns> </telerik:RadTreeListView> </Grid>
Best regards,
Jakub.
<Style TargetType="telerik:GroupHeaderRow">
<Setter Property="ShowGroupHeaderColumnAggregates" Value="True" />
<Setter Property="ShowHeaderAggregates" Value="False" />
</Style> But the result is double lines: one for group title and another to aggregates. I wanna aggregates in same line that group title but in collumns. Regards, JP.
On RowValidating, when a GridViewCellValidationResult is added with a PropertyName such as "Hours", and a column that precedes the Hours column has a binding path of say "SourceHours", the GridView logic incorrectly does a .Contains() on the PropertyName to get the cell, which leads to the SourceHours column being highlighted as the one with the validation error, instead of the Hours column.
I'm using Telerik.Windows.Controls.GridView, Version=2015.3.1104.45, and the offending method is Telerik.Windows.Controls.GridView.GridViewRow.TryGetCellFromPropertyName.
Here's the relevant XAML:
<telerik:GridViewDataColumn Header="Source Hours" DataMemberBinding="{Binding SourceHours}" DataFormatString="n" TextAlignment="Right" />
<telerik:GridViewDataColumn Header="Hours" DataMemberBinding="{Binding Hours}" DataFormatString="n" TextAlignment="Right" />
And here is how I'm adding the GridViewCellValidationResult in the RowValidating event handler:
if (attendance.Hours == 0m) {
e.ValidationResults.Add(new GridViewCellValidationResult { PropertyName = "Hours", ErrorMessage = "Hours cannot be zero."});
}
And this is why it's failing ( the Contains(this.propertyName) part):
internal bool TryGetCellFromPropertyName(string propertyName, out GridViewCell gridViewCell)
{
Func<GridViewBoundColumnBase, bool> func = (GridViewBoundColumnBase c) => c.GetDataMemberName().Contains(this.propertyName);
GridViewDataControl gridViewDataControl = base.GridViewDataControl;
if (string.IsNullOrEmpty(propertyName) || gridViewDataControl == null)
{
gridViewCell = null;
return false;
}
gridViewCell = (
from c in base.Cells.OfType<GridViewCell>()
where c.DataColumn != null
select c).FirstOrDefault<GridViewCell>((GridViewCell c) => func(c.DataColumn));
return gridViewCell != null;
}
If it instead was coded as c.GetDataMemberName() == this.propertyName (or similarly ignoring case if desired), it seems to me that it would work as expected.
For now I will use a UniqueName to get around the issue, but I wanted to bring it to Telerik's attention.
Hello.
I'am trying to bind ViewModel property to a CommandProperty of a GridViewCheckBox inside of CreateCellElement. Unfortunately the binded command doesn't run while clicking on checkbox. Any ideas why this isn't working?
I'm posting the code where I belive is the mistake. I have made a test Visual Studio 2013 project to try to solve this. It is enable to download here: HERE
Creating cell element:
internal class GroupDataGridCheckBoxColumn : GridViewCheckBoxColumn { private readonly Group _group; public GroupDataGridCheckBoxColumn(Group group) : base() { this._group = group; this.AutoSelectOnEdit = true; this.EditTriggers = GridViewEditTriggers.CellClick; } public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem) { GridViewCheckBox checkBox = base.CreateCellElement(cell, dataItem) as GridViewCheckBox; /// <THIS DOESNT WORK> /* Set Command binding */ Binding commandBinding = new Binding("DataContext.AddOrRemoveGroupCommand"); commandBinding.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(Window), 1); checkBox.SetBinding(CheckBox.CommandProperty, commandBinding); /* Set Command parameter */ MultiBinding commandParameterBinding = new MultiBinding(); commandParameterBinding.Converter = new CommandParameterMultiConverter(); commandParameterBinding.Bindings.Add(new Binding("IsChecked") { RelativeSource = RelativeSource.Self }); commandParameterBinding.Bindings.Add(new Binding(".")); //the employee object commandParameterBinding.Bindings.Add(new Binding(".") { Source = this._group }); //the group object checkBox.SetBinding(CheckBox.CommandParameterProperty, commandParameterBinding); /// <THIS DOESNT WORK/> return checkBox; } }
Any ideas? This error consumed 1 day of my work for now..
I was trying to figure out why the titles of my RadPanes were not being translated. I finally figured out that the LoadLayout() also loads the header of the panes and that overrides my XAML's {x:Static properties:Resources.xxx}.
I could say "After the LoadLayout(), change the title of each pane according to the resource strings" but it would be nice if it could be done directly in the XAML. I don't believe there's a way to prevent the "Header" tag from being included in the SaveLayout/LoadLayout functions, right? To tell you the truth, I don't even see why the header is included at all!
Hi!
The DocxFormatProvider resets any Color informations of any Styles to the default light blue when I export with it.
I export like this:
DocumentFormatProviderBase format = null; format = new DocxFormatProvider(); format.Export(radRichTextBox.Document, File.Open(filename, FileMode.Create));
I used versions 2015.3.1104.45, 2015.3.1104.40 and 2015.3.930.40
Did i miss some setting or, if not, is there any workaround?
It works fine with the htmlformatprovider, but i need the header and footer, which is cut off by it.

Hello.
I am experiencing a problem with RadDatePicker
In my application, the user chooses Start date and End date and according to that, the grid is updated.
I would like to avoid using Refresh button, i.e. letting the user pick both dates and then click refresh to get the data.
On the other hand, I don't want to update the data each time one of the Pickers is changed, before the second one is also picked.
I would like to do it this way: when user picks one of the dates, the second DatePicker expands for him so he can immediately choose a second date, and no need to click a refresh button. What happens is that DatePicker.IsDropDownOpen property seems not working from code behind.
In DatePicker1 SelectionChanged event handler, I am doing DatePicker2.IsDropDownOpen=true, but this doesn't work. The DatePicker2 stays closed.
Maybe there is another control, like doubleDatePicker which makes it possible to choose a range of dates? Like in CheckIn-Checkout pages on the internet, the datepicker control consists of 2 calendars.
Thanks in advance for your help.
Alexander
Hello,
I have a telerik radGridView that itemsSource binding to my list observableCollection<Class1>
i have a button that on her click event i i add a new item to my list, i want focus the new item first cell,
so i want do it with the event AddingNewDataItem but it not camming to this event.
heer is my xaml code:
<Grid>
<telerik:RadGridView x:Name="PricingGrid" ItemsSource="{Binding}"
CanUserInsertRows="True" ShowInsertRow="True"
AddingNewDataItem="PricingGrid_AddingNewDataItem"
RowEditEnded="PricingGrid_RowEditEnded" >
</telerik:RadGridView>
<Button Content="Button" HorizontalAlignment="Left" Height="61" Margin="269,237,0,0" VerticalAlignment="Top" Width="176" Click="Button_Click"/>
</Grid>
heer is my C# code:
public partial class MainWindow : Window
{
public CollectionViewSource Source { get; set; }
public ObservableCollection<MyClass> list = new ObservableCollection<MyClass>();
public MainWindow()
{
InitializeComponent();
this.Source = new CollectionViewSource();
//var list = new ObservableCollection<MyClass>();
for (int i = 0; i < 10; i++)
{
var item = new MyClass { MyProp2 = i, MyProperty = i * 10 };
list.Add(item);
}
Source.Source = list;
this.DataContext = Source.View;
}
private void PricingGrid_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
if (e.EditOperationType == Telerik.Windows.Controls.GridView.GridViewEditOperationType.Insert)
{
this.DataContext = Source.View.OfType<MyClass>().OrderBy(c => c.MyProperty);
Source.Source = this.DataContext;
PricingGrid.SelectedItem = e.NewData;
PricingGrid.ScrollIntoView(e.NewData);
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
list.Add(new MyClass { MyProp2 = 4, MyProperty = 40 });
}
private void PricingGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
{
}
}
public class MyClass
{
public int MyProperty { get; set; }
public int MyProp2 { get; set; }
}
thank for help!
miri.