Telerik Forums
UI for WPF Forum
2 answers
264 views
I want to create a number of grids that are bound to objects that have Boolean properties.

I want create a generic style that I can apply to various columns of my choosing that causes a cell to have "tick" if the value is true, but a "cross" if the value is false.

  <Style x:Key="YesNoCellStyle" TargetType="telerik:GridViewCell"
                <Setter Property="Template"
                    <Setter.Value> 
                        <ControlTemplate TargetType="telerik:GridViewCell"
                            <Image x:Name="img" Source="Images/tick.png" 
                                    Width="16" Height="16" /> 
                            <ControlTemplate.Triggers> 
                                <DataTrigger Binding="{Binding}" Value="False"
                                    <Setter TargetName="img" Property="Source" Value="Images/cross.png"/> 
                                </DataTrigger> 
                            </ControlTemplate.Triggers> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
   
So far I have not been able to accomplish this because the DataContext for the GridViewCell is an entire DataRecord, rather than just the field that I'm binding to that column.

Therefore my DataTrigger requires that I know the FieldName or the FieldPosition in order to retrieve the value; so I have to create a template for each DataObject. E.g.

<DataTrigger Binding="{Binding Path=Data.Type}" Value="False"
 
<DataTrigger Binding="{Binding Path=Data.IsAvailable}" Value="False"
 
<DataTrigger Binding="{Binding Path=Data.IsValid}" Value="False"

What I really want is for the Binding to be boudn to whatever value is in the cell being styled. Does anyone know how to acheieve this.

Regards

Justin

- Sorry if this is a little unclear, let me know if you need clarification.
JTango
Top achievements
Rank 1
 answered on 23 Sep 2008
4 answers
265 views
In a hierarchy gridview, is there a nested depth value, or a way to tell if the change is from a parent or child row?

void radGridView_SelectionChanged(object sender, SelectionChangeEventArgs e)

Thanks

Jonathan Miller
Top achievements
Rank 1
 answered on 22 Sep 2008
2 answers
88 views
I am finding features that I need are included in WPF SP1.

I have looked through the Telerik blogs and find them to say use Client.net account - I only have the trial - where can I get WPF SP1?

Jonathan Miller
Top achievements
Rank 1
 answered on 18 Sep 2008
2 answers
135 views
I am running Q2 2008, release date 9/10/2008 WPF.

Trying to use 

telerik

:Theming.Theme="Simple" //as stated in documentation

Only have  Caramel, Summer, Telerik available.

How/where can I get the simple theme?  I need to present to mgmt about this product to purchase in 2 days. thx

Jonathan Miller
Top achievements
Rank 1
 answered on 18 Sep 2008
1 answer
171 views
We are currently using a RadDatePicker in an input form and we have discovered a problem with tabbing - when we tab away from the RadDatePicker, we get an exception:

'ContentControl' TargetType does not match type of element 'Control'.

The stack trace shows that the exception is being thrown deep within WPF.

This is very simple to reproduce:

<Window x:Class="RadDatePickerTabBug.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:UI="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
Title="Window1" Height="300" Width="300">
<StackPanel Orientation="Vertical">
<UI:RadDatePicker/>
<TextBox/>
</StackPanel>
</Window>

Running this will reproduce the problem!

Can you help us?  The simplicity of reproducing this shows that it's not anything we're doing with styling, retemplating, etc. on the RadDatePicker.

Regards

Chris
Miroslav
Telerik team
 answered on 18 Sep 2008
4 answers
97 views
Good stuff!

Any idea when the WPF and Silverlight controls will be production ready?

Thanks
Lin
Telerik team
 answered on 18 Sep 2008
0 answers
115 views
Hello,
I have RadPanelBar and some RadPanelBarItem (on Level 0).
How i can get (for example into event RadPanelBar_Expanded) RadPanelBarItem  index

 private void RadPanelBar_Expanded(object sender, Telerik.Windows.RadRoutedEventArgs e) 
    RadPanelBarItem element = e.Source as RadPanelBarItem; 
       
           //How get element.Index or panelBar.SelectedIndex?????  


Thanks.

Find decision panelBar.Items.GetIndexOf(...). Can delete this Thread.
Anton Samarin
Top achievements
Rank 1
 asked on 18 Sep 2008
2 answers
231 views
Hi

I am having trouble with the automaic resizing of the radgridview control. If I place it directly inside a grid column row and then set margins to 0 every thing works great and the radgridview fills the area.

If, however, I package the gridview in a usercontrol (within a grid element), and set the margins to 0, the radgridview fills the area as expected. When I then place the resultant usercontrol within a grid cell on a page the usercontrol does not honour the margin 0 properties. The radgridview seems to keep the usercontrol a constant size when manipulating the anchored margins within expression, Visual Studio or manually in the XAML.

I am wondering firstly if this is a bug, secondly if there is a workaround. In your sample application it seems to work fine.

Thanks in advance
Dylan
dylan
Top achievements
Rank 1
 answered on 17 Sep 2008
1 answer
132 views
How can i change the backgroundcolor and foregroundcolor of a row in C#?

For example i have a grid with two columns Personname and Country
all rows with country xxx should be red and the foregroundcolor should be blue
Atanas
Telerik team
 answered on 16 Sep 2008
2 answers
146 views
Dear All

We are using a theme to restyle the GridView.  We had it looking great in our app before we incorporated the service pack, but now certain things have changed and it looks as if parts of the style for GridViewHeaderCell objects in the header are not being honoured.

In particular, we have this in the ControlTemplate:

<

ContentPresenter Margin="7,4"

HorizontalAlignment="Left"

.../>

-------------
When we use Snoop to look at the resulting visual tree, neither the margin nor the alignment are set to these values.  They are "0" and "Center" respectively and their source is given as "ParentTemplate".  I had to resort to setting a margin on GridViewHeaderCell to get the previous appearance and I can't find a way of getting Left alignment on the header text.

Is the GridView setting these programmatically?  If we had the source for the service pack, we could track this down ourselves.

Thanks for your help

Chris

Pavel Pavlov
Telerik team
 answered on 16 Sep 2008
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?