Telerik Forums
UI for WPF Forum
1 answer
123 views
Hi, I'm trying to pass a list into GridView. It always display the correct number of rows according to the list I pass in, but all cells are blank. Any idea why this is so?

<telerik:RadGridView x:Name="gridCommsEqp" CanUserDeleteRows="False" ItemsSource ="{Binding}" AutoGenerateColumns="False" CanUserInsertRows="False" IsSynchronizedWithCurrentItem="True" ColumnWidth ="Auto" Width ="500" Margin="488,23,62,262" CanUserResizeRows="True" IsReadOnly="True" MouseDoubleClick="gridCommsEqp_MouseDoubleClick">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SSN}" Header="SSN" UniqueName="SSN" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Description}" Header="Description" UniqueName="Description" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CurrentQty}" Header="CurrentQty" UniqueName="CurrentQty" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=TotalQty}" Header="TotalQty" UniqueName="TotalQty" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Assemblage}" Header="Assemblage" UniqueName="Assemblage" TextWrapping="Wrap"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=UI}" Header="UI" UniqueName="UI" TextWrapping="Wrap"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

Dictionary<string, List<CommsEqp>> sd = new Dictionary<string, List<CommsEqp>>();
            sd = issueAdapt.getAllCommsEqp();
            gridCommsEqp.DataContext = sd["nonSetEquips"];
        }
//gridCommsEqp.DataContext = issueAdapt.getAllCommsEqp().DefaultView.Table;



Above are my codes. The last line, which is the commented codes, works if I get "issueAdapt.getAllCommsEqp()" to return a DataTable.

Hristo
Telerik team
 answered on 20 Mar 2014
3 answers
466 views
Hi,

I need to change the selected data template based on the state of the view model(the binding)
Here is my Xaml
(the content always point to "MainViewModel")

<telerik:RadTransitionControl

Name="radTransitionControl1"

ContentTemplateSelector="{StaticResource pageTemplateSelector}"

Transition="{Binding Transition}"

Content="{Binding}">

 

</telerik:RadTransitionControl>


Thanks in advance
Ramon
Top achievements
Rank 1
 answered on 20 Mar 2014
3 answers
429 views

0
down vote

I am very new to RadCartesianChart.I created a chart in wpf using below code.I got empty screen when i execute.I want to add any property in RadCartesianChart.HorizontalAxis or RadCartesianChart.VerticalAxis .Am I missed anything.Please help me.

<Window x:Class="LineChart.TwoVerticalAxes"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="TwoVerticalAxes" Height="300" Width="300">
<Grid>
<telerik:RadCartesianChart>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.HorizontalAxis>

<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Maximum="100" ElementBrush="Orange"/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.Series>
<telerik:LineSeries Stroke="Orange" StrokeThickness="2">
<telerik:LineSeries.DataPoints>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="40"/>
<telerik:CategoricalDataPoint Value="35"/>
<telerik:CategoricalDataPoint Value="40"/>
<telerik:CategoricalDataPoint Value="30"/>
<telerik:CategoricalDataPoint Value="50"/>
</telerik:LineSeries.DataPoints>
</telerik:LineSeries>

<telerik:LineSeries Stroke="Blue" StrokeThickness="2">
<telerik:LineSeries.VerticalAxis>
<telerik:LinearAxis HorizontalLocation="Right" ElementBrush="Blue" />
</telerik:LineSeries.VerticalAxis>
<telerik:LineSeries.DataPoints>
<telerik:CategoricalDataPoint Value="30"/>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="15"/>
<telerik:CategoricalDataPoint Value="50"/>
<telerik:CategoricalDataPoint Value="20"/>
<telerik:CategoricalDataPoint Value="60"/>
</telerik:LineSeries.DataPoints>
</telerik:LineSeries>
</telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>
</Grid>
</Window>
Martin Ivanov
Telerik team
 answered on 20 Mar 2014
4 answers
484 views
How to set CellStyle with Auto Generated Columns?

CellStyle is usually set within GridViewDataColumn <t:GridViewDataColumn CellStyle="{StaticResource MyCellStyle}"

But what if AutoGenerateColumns is set to true?

I tried in code behind but couldn't find what to cast the object FindResouce returns to:

        private void GridViewDataControl_OnDataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            var rgv = sender as RadGridView;
            if (rgv == null) return;
            foreach (var col in rgv.Columns)
            {
                col.CellStyle = FindResource("MyCellStyle") as ?
            }
        }
Dean
Top achievements
Rank 1
 answered on 20 Mar 2014
9 answers
199 views
Hello,

We are having a situation where the ContextMenu property for the RadRichTextBox is showing as null.  What would cause this?  Could this be from assembly reference issues?  We have one application that is working and another that is not even though they are running the same code/xaml from a shared assembly.

Thanks,
Wil
Wil
Top achievements
Rank 1
 answered on 20 Mar 2014
1 answer
151 views
I'm certain I've seen a forum post on this topic before but I've been unable to track it down again so sorry for any duplication. 

I have a bar chart that shows several different series with one numerical and one categorical  axis. Is it possible to hide a category on the CategoricalAxis in a similar way that hiding series is possible, without have to rebuild the chart from scratch excluding the "hidden" data?

Thanks,

Andy.
Martin Ivanov
Telerik team
 answered on 20 Mar 2014
1 answer
66 views
Hello;

I am using the telerik FluidContentControl to define a dashbaord with different tiles. In my requirement, I need to  set the header of small and medium views with the short descripton of a translatbale string and the header of large view with the long description.

Is it possible to do this ?
I tried to used selectors, but without any success.
Thanks for your help
Sam
Boris
Telerik team
 answered on 20 Mar 2014
2 answers
2.7K+ views
Hi,

I'm experiencing some issues with Observablecollection<T> bound to the RadGridView.
As long as I'm inserting or deleting items in the Collection it updates just fine, but if I try to
update an item with a new value, the GridView doesn't do anything.

What I have is this:

ObservableCollection(OverviewData) ocOverviewData = new ObservableCollection(OverviewData);

which I then bind to the grid using
rgvItems.ItemSource = ocOverviewData;

When an update occurs it's just a simple iteration over the Collection like this:

foreach(OverviewData d in ocOverviewData)
{
    if(d.ReceiverName != newValue)
{
   d.ReceiverName = newValue;
}
}

The object looks like this:
public class OverviewData : INotifyPropertyChanged
{
    private string _ReceiverName;
    public string ReceiverName
    {
        get { return _ReceiverName; }
        set
        {
            if (_ReceiverName == value)
                return;                _ReceiverName = value;
            OnPropertyChanged(new PropertyChangedEventArgs("ReceiverName"));
        }
    }        private string _ReceiverAddress;
    public string ReceiverAddress
    {
        get { return _ReceiverAddress; }
        set
        {
            if (_ReceiverAddress == value)
                return;                _ReceiverAddress = value;
            OnPropertyChanged(new PropertyChangedEventArgs("ReceiverAddress"));
        }
    }        public event PropertyChangedEventHandler PropertyChanged;
    public void OnPropertyChanged(PropertyChangedEventArgs e)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, e);
    }
}

Yet, if I update any value in the observablecollection, as previously mentioned, nothing updates in the UI of the grid.
The main reason I use observablecollection is to have the grid update only the items and properties needed, not rebind
the whole grid (which can be a couple of 1000 items at a time) which would ruin the grouping, sorting and so on and incur
a break in the work process for the people using the program.

How can I make the gridview update on value changes in the items?

Thanks in advance. :)

//Johannes

Yoan
Telerik team
 answered on 20 Mar 2014
1 answer
147 views
Hi

Is it possible to increase thickness of the rectangle which appears when a RadDiagramShape is selected (The rectangle with thumbs at the corners).

Regards
Jeevan
Petar Mladenov
Telerik team
 answered on 20 Mar 2014
7 answers
917 views
I am using a DatePicker as follows;

<telerik:RadDatePicker Name="dtpPublished"
    Margin="2"  
    Grid.Row="2"
    Grid.Column="1"
    HorizontalAlignment="Left"
    HorizontalContentAlignment="Left"
    VerticalAlignment="Center"
    MinWidth="500"
    MaxWidth="500"
    DateTimeWatermarkContent="Leave blank or enter the date this Scenario was published"
    SelectedDate="{Binding Path=PublishedDt, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
</telerik:RadDatePicker>

In the code behind I am setting the Culture and date format as follows;

With dtpPublished
    .Culture = New System.Globalization.CultureInfo("en-AU")
    .Culture.DateTimeFormat.ShortDatePattern = "d-MM-yyyy"
    .Culture.DateTimeFormat.ShortTimePattern = "hh:mm"
 
    .Culture.DateTimeFormat.LongDatePattern = "ddd, d MMM yyyy"
    .Culture.DateTimeFormat.LongTimePattern = "h:mm:ss tt"
 
    .DisplayFormat = Telerik.Windows.Controls.DateTimePickerFormat.Long
End With

My problem is if I clear the displayed date by pressing delete when the date text is highlighted I want the control to update the source as if a date wasn't entered.  Effectively it should set the source to Nothing or to Date.MinValue.  Even after I Tab off the control the source isn't updated?

Preferably the control should display a blank entry rather than "1/01/0001" as the date.
Kalin
Telerik team
 answered on 20 Mar 2014
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?