Telerik Forums
UI for WPF Forum
5 answers
1.1K+ views
Hy all,

I tried to bind the IsPinned and the Visiblity property of the RadPane. When a user logs-in IsPinned shall be set to true and Visibility is set to Visible. On the other hand on logout IsPinned=false and Visibility=Hidden.

Unfortunately on login the Pane is not pinned?
Is there an other way to implement this?

I'm using the latest oficial release.
Dani
Telerik team
 answered on 22 Mar 2011
5 answers
344 views

Hello, I have two question about Grid View.

 

Q1. How to change background color of the title row? I’d tried to change the background color of some columns’ title, but the first column’s background and the border are still black.

 

Q2. I also don’t know how to change the background of the child table.

 

Thank you!

Zhiwei.

Vanya Pavlova
Telerik team
 answered on 22 Mar 2011
3 answers
151 views
Hi

I'm attempting to create a custom template for the RadGridView control. When I try to do this, Blend hangs. I am using the latest Q1 release of the Telerik controls, and

To reproduce the issue:

1. Create a blank wpf project in Blend
2. Drag a RadGridView onto the main window.
3. Edit a copy of the current style for the RadGridview
4. Edit the current template of this Style
5. Blend freezes.

Anyone else see this?

Tom
Vanya Pavlova
Telerik team
 answered on 22 Mar 2011
2 answers
145 views
Hi,
I'm  trying to display two datatypes in a RadTreeListView through XML. The first datatype, 'Director', with two properties: 'Name', and a property 'Function' . Function contains two properties i.e Name and FunctionType.


--------------------------------------------------------------------------------------------------
public
class Director
{
    public string Name{ get; set; }
    public ObservableCollection<Function > Function { get; set; }
}
 
public class Function
{
    public string Name { get; set; }
    public string FunctionType{ get; set; }
 }

 

 

 

<Window.Resources>

 

 

 

<local:RadTreeListXmlDataSource x:Key="TreeSource" Source="TestData.xml" />

 

 

 

 

 

</Window.Resources>

 

 

 

 

 

 

 

  <telerik:RadTreeListView CellEditEnded="RadTreeListView1_CellEditEnded" x:Name="RadTreeListView1" RowIsExpandedChanged="RadTreeListView1_RowIsExpandedChanged"

 

 

 

 

  AutoGenerateColumns="False" ItemsSource="{StaticResource TreeSource}">

 

 

 

 

  <telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

  <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />

 

 

 

 

  </telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

  <telerik:RadTreeListView.Columns>

 

 

 

 

  <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />

 

 

 

 

  <telerik:GridViewDataColumn DataMemberBinding="{Binding Source}" Header="Type" />

 

  

 

</telerik:RadTreeListView.Columns>

 

 

 

 

</telerik:RadTreeListView>

 




-------------------------------------------------------------------------------------------------

I was able to edit the Director's properties but when I tried to edit Function's properties i.e Funnction Name ,
I got an error saying "Object does not match target type".
Can you please provide a sample for the above functionality?


Sharada
Top achievements
Rank 1
 answered on 22 Mar 2011
2 answers
130 views
In other products, I had a ValuePath property and Value property, which allowed me to specify
1. The property of the lookup collection to use for the identifier of the value on the data context (ValuePath)
2. The value of the item in the data context, uh, (Value)

I assume SelectedValue is the property for Value?

Is there a ValuePath property? How do I specify that StateId from a State collection bound to the radcombo is the property to use for StateId on a Address object?

Thanks,

Morgan
Morgan
Top achievements
Rank 1
 answered on 22 Mar 2011
1 answer
77 views
I'd like to change the itemtemplate of the radcombobox depending on wheter it's opened or closed.

Is it possible? any help on how to accomplish it?

Thanks in advance.
Sergi
Top achievements
Rank 1
 answered on 21 Mar 2011
3 answers
111 views
Hi,

I have noticed, even in your example "Customize auto-generated fields" that certain fields after created are editable even when not in edit mode, an example of this is "StartingDate" in your example. I have created a RadComboBox in my application and I have noticed that indeed it is editable even when not in edit mode. Do I need to handle enabling and disabling of these controls myself?

Thanks,
Daryl
Vlad
Telerik team
 answered on 21 Mar 2011
3 answers
185 views
Hello everyone,

we have the following use case: a RadGridView with a Details section where both, the row and the details section has editable contents. If someone changes a property (either in a cell or in a control inside the details section) we need to defer sorting actions of the rad grid view in order to prevent the current item to be sorted "out of scope". This happens if you have a lot of items, sort by property 1 ascending, then change the value of "A" to "Z" (which re-sorts the current item to the end of the list).

We tried hooking up to sorting event and set the cancel flag to "false" but it is not called if you the cell is commited on focus lost. We tried also to set ActionOnLostFocus to none, but after clicking on a empty region inside the details element (i.e. not a button) the current cell is committed and the gridview re-sorts itself.

Any advise how to prevent the grid to automatically sort our current selected item out of view?

Example:

<telerik:RadGridView Sorting="Grid_Sorting"  x:Name="Grid" ActionOnLostFocus="None" AutoGenerateColumns="False" RowDetailsVisibilityMode="VisibleWhenSelected">
         <telerik:RadGridView.Columns>
             <telerik:GridViewDataColumn IsReadOnly="False" DataMemberBinding="{Binding FormOfAddress}">
                 <telerik:GridViewDataColumn.CellEditTemplate>
                     <DataTemplate>
                         <ComboBox SelectedItem="{Binding FormOfAddress}" ItemsSource="{Binding AvailableFormOfAddresses}" />
                     </DataTemplate>
                 </telerik:GridViewDataColumn.CellEditTemplate>
             </telerik:GridViewDataColumn>
         </telerik:RadGridView.Columns>
         <telerik:RadGridView.RowDetailsTemplate>
             <DataTemplate>
                 <Border Background="Red" Width="100" Height="100">
                     <StackPanel>
                         <!-- Clicking on this text commits the ComboBox and re-sorts the grid -->
                         <TextBlock Text="{Binding FormOfAddress}" />
                           
                         <!-- Clicking on this button does not commit the ComboBox -->
                         <Button Content="Save" />
                     </StackPanel>
                 </Border>
             </DataTemplate>
         </telerik:RadGridView.RowDetailsTemplate>
     </telerik:RadGridView>

Code behind:
private void Grid_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e) {
    Debug.WriteLine("Sorting called.");
}

The output "Sorting called" is only shown if a user sorts the column, but if the grid itself re-sorts it this text is not printed and therefore can't be canceled.

Version: RadControls for WPF Q1 2011

Thanks in advance,

Christian

Vlad
Telerik team
 answered on 21 Mar 2011
1 answer
243 views
Hello,

I have a small problem.
As the data source of the chart I am using a DataTable because the DataSeries can be added dynamically.
Therefore it was the easiest way for me.

The DataTable has the following structure
   - Timestamp : DateTime
   - Value1 : double
   - Value2 : double

The problem is that in my case it is possible that a few rows have Value1 or Value2 = null because there was no value at this timestamp.
The chart displays this null value as 0. But for me it would be nice if it just ignores the null value

I created a small example which shows the problem:
public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
 
      var dt = new DataTable();
      dt.Columns.Add("Timestamp", typeof(DateTime));
      dt.Columns.Add("Value1", typeof(double));
      dt.Columns.Add("Value2", typeof(double));
 
      for (int i = 0; i < 20; i++)
      {
        var obj = new object[3];
        obj[0] = DateTime.Now.AddHours(i);
        obj[1] = i;
        if (i % 2 != 0)
          obj[2] = i + 1;
        else
          obj[2] = null;
        dt.Rows.Add(obj);
      }
 
      chart.ItemsSource = dt;
 
      SeriesMapping seriesMapping = new SeriesMapping();
      seriesMapping.SeriesDefinition = new LineSeriesDefinition();
      seriesMapping.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.XValue,
        FieldName = "Timestamp",
        FieldType = typeof(DateTime)
      });
      seriesMapping.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.YValue,
        FieldName = "Value1",
        FieldType = typeof(double)
      });
      chart.SeriesMappings.Add(seriesMapping);
       
      SeriesMapping seriesMapping1 = new SeriesMapping();
      seriesMapping1.SeriesDefinition = new LineSeriesDefinition();
      seriesMapping1.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.XValue,
        FieldName = "Timestamp",
        FieldType = typeof(DateTime)
      });
      seriesMapping1.ItemMappings.Add(new ItemMapping
      {
        DataPointMember = DataPointMember.YValue,
        FieldName = "Value2",
        FieldType = typeof(double)
      });
      chart.SeriesMappings.Add(seriesMapping1);
    }
  }


When you try this you will see that the second Series looks a bit strange because it added 0 instead of ignoring the null value.

Is there a workaround for that? 
How can I fix this problem?

I am using Version: 2010.3.1110.35

Kind Regards
Michael
Michael
Top achievements
Rank 1
 answered on 19 Mar 2011
1 answer
61 views
Hi, 
I just have installed wpf q1 2011 trial version, and after I convert my project I noticed that horizontal alignment for some controls are not working (rad expander, border). They just don't respond to changing alignment, it is impossibly to stretch control inside some container(grid or border)...
Do You know something about  this strange behavior?
Nebojsa Danilovic
Tina Stancheva
Telerik team
 answered on 19 Mar 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?