This question is locked. New answers and comments are not allowed.
Hello,
I've got a column defined as this :
With this I don't see the filtering/ordering button... how can I enable it?
Thanks in advance
Paolo
I've got a column defined as this :
| <telerikGridView:GridViewDataColumn HeaderText="Descr. Cliente" IsReadOnly="True" Width="400" IsSortable="True" IsReorderable="True"> |
| <telerikGridView:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <StackPanel> |
| <HyperlinkButton Content="{Binding DescrizioneCliente}" TargetName="_blank" |
| Click="HyperlinkButton_Click" Tag="{Binding NDG}" > |
| </HyperlinkButton> |
| <TextBlock HorizontalAlignment="Left" Width="400" Text="{Binding Description}" TextWrapping="Wrap"> |
| </TextBlock> |
| </StackPanel> |
| </DataTemplate> |
| </telerikGridView:GridViewDataColumn.CellTemplate> |
| </telerikGridView:GridViewDataColumn> |
With this I don't see the filtering/ordering button... how can I enable it?
Thanks in advance
Paolo
7 Answers, 1 is accepted
0
Hi Paolo,
You should set column's DataMemberBinding to {Binding DescrizioneCliente} in your case if you want to sort and filter on that field.
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You should set column's DataMemberBinding to {Binding DescrizioneCliente} in your case if you want to sort and filter on that field.
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michele
Top achievements
Rank 2
answered on 26 Aug 2009, 01:06 PM
Thanks for your reply Stefan,
btw I fixed it yesterday using "UniqueName" field... setting it it runs ok...
thanks!
btw I fixed it yesterday using "UniqueName" field... setting it it runs ok...
thanks!
0
Tim
Top achievements
Rank 1
answered on 19 Sep 2009, 02:45 AM
Are there restrictions on what templates one can use or anything at all that makes some of my grid columns sortable/filterable and others not? I pretty much the same code in a few places, but I get inconsistent results and I am not certain why some are and some aren't sortable.
For example, this one works:
But this one does not:
I got the original idea from someone here and it works, but repeating the pattern does not always work. In both cases, I just want to have an image/icon alongside the priority or severity. I believe at one point I added the DataMemberBinding parameter and it made no difference.
Thx,
Tim
For example, this one works:
| <TelerikGridView:GridViewDataColumn |
| HeaderText="Severity" UniqueName="Severity" Width=".15*"> |
| <TelerikGridView:GridViewDataColumn.CellStyle> |
| <Style TargetType="GridView:GridViewCell"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="GridView:GridViewCell"> |
| <Grid x:Name="SelectionBackground" |
| Background="{TemplateBinding Background}"> |
| <Border BorderThickness="{TemplateBinding BorderThickness}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| Background="{TemplateBinding Background}"> |
| <StackPanel Margin="{TemplateBinding Margin}" |
| Orientation="Horizontal"> |
| <Image VerticalAlignment="Center" |
| Source="{Binding Path=Severity, Converter={StaticResource EventSeverityConverter}}"/> |
| <TextBlock Margin="3,0,3,0" VerticalAlignment="Center" |
| Text="{Binding Path=Severity, Converter={StaticResource EventSeverityConverter}}"/> |
| </StackPanel> |
| </Border> |
| <Rectangle x:Name="PART_HorizontalGridLine" Height="1" Fill="#FFD0D7E5" |
| VerticalAlignment="Bottom" HorizontalAlignment="Stretch" /> |
| <Rectangle x:Name="PART_VerticalGridLine" Width="1" Fill="#FFD0D7E5" |
| VerticalAlignment="Stretch" HorizontalAlignment="Right" /> |
| </Grid> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </TelerikGridView:GridViewDataColumn.CellStyle> |
| </TelerikGridView:GridViewDataColumn> |
But this one does not:
| <TelerikGridView:GridViewDataColumn |
| HeaderText="Priority" UniqueName="Priority" |
| Width=".1*" IsReadOnly="True"> |
| <TelerikGridView:GridViewDataColumn.CellStyle> |
| <Style TargetType="GridView:GridViewCell"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="GridView:GridViewCell"> |
| <Grid x:Name="SelectionBackground" Background="{TemplateBinding Background}"> |
| <Border BorderThickness="{TemplateBinding BorderThickness}" |
| BorderBrush="{TemplateBinding BorderBrush}" |
| Background="{TemplateBinding Background}"> |
| <StackPanel Margin="{TemplateBinding Margin}" Orientation="Horizontal"> |
| <Image VerticalAlignment="Center" Source="{Binding Path=Priority, Converter={StaticResource PriorityParameterConverter}}"/> |
| <TextBlock Margin="3,0,3,0" VerticalAlignment="Center" Text="{Binding Path=Priority, Converter={StaticResource PriorityParameterConverter}}"/> |
| </StackPanel> |
| </Border> |
| <Rectangle x:Name="PART_HorizontalGridLine" Height="1" Fill="#FFD0D7E5" |
| VerticalAlignment="Bottom" HorizontalAlignment="Stretch" /> |
| <Rectangle x:Name="PART_VerticalGridLine" Width="1" Fill="#FFD0D7E5" |
| VerticalAlignment="Stretch" HorizontalAlignment="Right" /> |
| </Grid> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| </Style> |
| </TelerikGridView:GridViewDataColumn.CellStyle> |
| </TelerikGridView:GridViewDataColumn> |
I got the original idea from someone here and it works, but repeating the pattern does not always work. In both cases, I just want to have an image/icon alongside the priority or severity. I believe at one point I added the DataMemberBinding parameter and it made no difference.
Thx,
Tim
0
Hello Tim,
It depends on what is the underlying data type of the column. In your case what is the type of the Severity and Priority properties?
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
It depends on what is the underlying data type of the column. In your case what is the type of the Severity and Priority properties?
Regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tim
Top achievements
Rank 1
answered on 23 Sep 2009, 12:14 PM
Sorry, I should have included the types in the original. Both are simple enum-s:
| public enum EventSeverity |
| { |
| Unknown, |
| Error, |
| Information, |
| Warning, |
| } |
| public enum EventPriority |
| { |
| Lowest = 0, |
| High = 24, |
| Normal = 16, |
| Low = 8 |
| } |
0
Hello Tim,
I have tried to replicate your scenario locally but everything works as expected. Maybe I'm missing something from your case. Can you please send us a small sample application that illustrates your scenario exactly?
Kind regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I have tried to replicate your scenario locally but everything works as expected. Maybe I'm missing something from your case. Can you please send us a small sample application that illustrates your scenario exactly?
Kind regards,
Stefan Dobrev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tim
Top achievements
Rank 1
answered on 25 Sep 2009, 02:59 PM
While trying to reduce the example, I found the problem - it had to do with a refactoring missing the UniqueName parameter because of the late binding. Or possibly a mis-understanding to make it match the column header when it should not.
I'm all set now, thanks - and sorry for wasting your time :(
Tim
I'm all set now, thanks - and sorry for wasting your time :(
Tim