Sarit Harel
Top achievements
Rank 1
Sarit Harel
asked on 08 Feb 2010, 01:26 PM
Hello,
I am using telerik:RadGridView, my Items is set to a DataTable.
the source Data tableis set to a SQL Query output, data is in a specific dateformat.
In case we setAutoGemerateColumns="true"; the data is displayed only in a modify format (thedata is date and time and the display automatic adds slashes, removes secondsand millisecond)
In the other case(AutoGemerateColumns="false") I have three columns specify and binded to each column;
the results are only visible by row count, the columns data is empty.
appreciate your advise,
Thank you
SaritHarel, IAI
5 Answers, 1 is accepted
0
Hi Sarit Harel,
Please paste me your XAML ( the definition of RadGridView with columns ) and I will try to see where the problem is .
All the best,
Pavel Pavlov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Please paste me your XAML ( the definition of RadGridView with columns ) and I will try to see where the problem is .
All the best,
Pavel Pavlov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Sarit Harel
Top achievements
Rank 1
answered on 08 Feb 2010, 03:55 PM
Hi Pavel,
As you requested my xaml:
<Border x:Name="resultDataList" HorizontalAlignment="Right" Width="914.02" Height="195.796" Background="#FF7589AA" Canvas.Left="46" Canvas.Top="480" BorderBrush="#FF4D6F92" CornerRadius="2" BorderThickness="1">
<Grid>
<TextBlock Foreground="#FFFCFAFA" Width="50" Text="Results" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="10.991,8,0,0" VerticalAlignment="Top" Height="13.561"/>
<telerik:RadGridView x:Name="resultsDataListView" AutoGenerateColumns="True"
ColumnsWidthMode="Fill" ForceCursor="True" Margin="3,30,3,3"
Background="White" BorderBrush="#FF4E4E4E" IsTabStop="True" AllowDrop="True" ClipToBounds="True"
SnapsToDevicePixels="True" AreRowDetailsFrozen="False" AutoExpandGroups="True" MultipleSelect="False" ShowGroupPanel="False"
UseAlternateRowStyle="True" VerticalGridlinesBrush="Black" AutoGenerateHierarchyFromDataSet="False" CanUserInsertRows="False" IsReadOnly="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Start Time" DataMemberBinding="{Binding DateTimeFrom}"
Focusable="True" IsFilterable="True"/>
<telerik:GridViewDataColumn Header="End Time" DataMemberBinding="{Binding DateTimeTo}"
Focusable="True" IsFilterable="True"/>
<telerik:GridViewDataColumn Header="Duration" DataMemberBinding="{Binding Duration}"
Focusable="True" IsFilterable="True" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowAppearance>
<telerik:RowAppearanceSettings/>
</telerik:RadGridView.RowAppearance>
</telerik:RadGridView>
<Button x:Name="btnPlay" Style="{DynamicResource btnPlayStyle}"
IsEnabled="False" ToolTip="Select a favorite formula"
Width="90" Height="22" d:IsStaticText="False" FontSize="13.333" FontFamily="Arial" HorizontalAlignment="Right" Margin="0,4.668,3,0" VerticalAlignment="Top">
<Button.DataContext>
<Image/>
</Button.DataContext>
<Image Width="11" Height="13" Source="Resources/Play_icon.png" Stretch="Fill" RenderTransformOrigin="-1.423,0.567" Margin="0,0,60,0"/>
</Button>
</Grid>
</Border>
Thank you
Sarit
0
Hello Sarit Harel,
Please try the following : In the Binding when specifying the field name , please surround it with [ ]
For example:
Instead of : ="{Binding DateTimeFrom}"
use : ="{Binding [DateTimeFrom]}"
This is needed when binding to a datatable in WPF.
Best wishes,
Pavel Pavlov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Please try the following : In the Binding when specifying the field name , please surround it with [ ]
For example:
Instead of : ="{Binding DateTimeFrom}"
use : ="{Binding [DateTimeFrom]}"
This is needed when binding to a datatable in WPF.
Best wishes,
Pavel Pavlov
the Telerik team
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Sarit Harel
Top achievements
Rank 1
answered on 08 Feb 2010, 04:34 PM
Hello Pavel Pavlov
Thank you for the quick replay it helpd !! but... I still get the same data with AutoGenerateColumns = true or AutoGenerateColumns = false in the binded columns. The RadGridview still automatic changes the format adding slashes and removing part of the time stamp.
Is there any way to diable this beahaivoir? Can there be a diffrent source for the GridView behaivor?
Thank you again
Sarit Harel
0
Hi Sarit Harel,
To gain more control on what format to be used when displaying DateTime , please use the
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
To gain more control on what format to be used when displaying DateTime , please use the
DataFormatString property of the column.
Best wishes,Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.