Hy everyone,
I have a collection from DB:
var dynamicOutput = _sql.LoadData<dynamic, dynamic>(@"SELECT * FROM " + procedura.Trim() + "(@IdRamura, @DataRef)", p);
RaportRentabilitateGrid2.AddRange(dynamicOutput );
private ObservableRangeCollection<ExpandoObject> _raportRentabilitateGrid2 = new ObservableRangeCollection<ExpandoObject>();
public ObservableRangeCollection<ExpandoObject> RaportRentabilitateGrid2 {
get { return _raportRentabilitateGrid2; }
set {
_raportRentabilitateGrid2 = value;
OnPropertyChanged(nameof(RaportRentabilitateGrid2));
}
}
So far everything works ok
I have the RadGridView:
<telerik:RadGridView x:Name="oRaportRentabilitateDet1" DockPanel.Dock="Top"
Style="{StaticResource ContasGridviewStyle}"
Background="White"
AutoGenerateColumns="True"
SelectionUnit="FullRow"
SelectionMode="Single"
HorizontalContentAlignment="Left"
RowIndicatorVisibility="Collapsed"
ShowGroupPanel="False"
IsReadOnly="True"
SelectedItem="{Binding SelectedRaportRentabilitateGrid2,Mode=TwoWay}"
ItemsSource = "{Binding RaportRentabilitateGrid2, Mode=TwoWay}"
VerticalAlignment="Stretch"
Margin="5,0,5,10"
IsSynchronizedWithCurrentItem="True"
IsFilteringAllowed="False"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto">
And, for formatting the column in the RadGridView with the name DATA, i have the code:
var delaColumn = oRaportRentabilitateGrid2.Columns["DATA"] as Telerik.Windows.Controls.GridViewDataColumn;
delaColumn.DataFormatString = "dd.MM.yyyy";
But, it's not working...
I can't figure out why...
Thanks a lot.