Telerik Forums
UI for WPF Forum
1 answer
227 views
Hello,
I am using Telerik RadControlls for WPF Q3 2009.

I have RadNumericUpDown defined in xaml as follows:

<Telerik:RadNumericUpDown Height="25" Width="100" CustomUnit="kg" Minimum="0" Maximum="250" ValueFormat="Numeric" NullValue="N/A" IsInteger="True"  Value="{Binding Path=Weight, Mode=TwoWay}"/>

I am binding the value to property on my ViewModel class. The property is of ?float type. It returns float or null. When it returns float number, the NumericUpDown works fine. But when the property returns null, the NumericUpDown displays "0 kg" instead of "N/A". It is impornant for my application to distinguish between 0 and null, but the NumericUpDown seems to fail at this.

Is this bug or am I missing something?

Thanks
Lukas
Konstantina
Telerik team
 answered on 07 Dec 2009
19 answers
1.3K+ views
Hi @ All

I'm wondering if it is possible to set the rowstyle in a RadGridView according the containing data item. I was trying something like this:

<UserControl.Resources> 
    <Style TargetType="{x:Type telerik:GridViewRow}"
        <Setter Property="Background" Value="#00FF00"/> 
        <Style.Triggers> 
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource DataContext},  
                Path=HighlightRow}" Value="True"
                <DataTrigger.Setters> 
                    <Setter Property="Foreground" Value="#FF0000"/> 
                    <Setter Property="FontSize" Value="14"/>  
                </DataTrigger.Setters> 
            </DataTrigger> 
        </Style.Triggers> 
    </Style> 
</UserControl.Resources> 

but that does actually not succeed! I already found out, that the DataSource property of the GridViewRow does not contain the single row data, but the whole DataGrid data.
so, what would be the best was to do that?

Regards
Simon
Rossen Hristov
Telerik team
 answered on 07 Dec 2009
3 answers
116 views
In a radGridView I have few readonly fields and some editable fields when we select grid and press tab ,it pu focus on readonly columns also.But I want to disable this behaviour that not to put focus on readonly tabs instead focus on editable tabs.
Rossen Hristov
Telerik team
 answered on 07 Dec 2009
3 answers
145 views
Hi,

I have a RadNumericUpDown control on which I set the Width to 70, but then the text disappears. If the Width is 80, the text is visible properly.
Pana
Telerik team
 answered on 07 Dec 2009
1 answer
63 views
With Ms ListView I can do like this

int _selIndex = dataGrid.SelectedIndex;  
 
MyCollection _data1 = (MyCollection)dataGrid.Items[_selIndex - 1];  
MyCollection _data2 = (MyCollection)dataGrid.Items[_selIndex];  
MyCollection _data3 = (MyCollection)dataGrid.Items[_selIndex + 1]; 

But I can't figure out how to do this with RadGridView.

Vlad
Telerik team
 answered on 07 Dec 2009
4 answers
322 views
I have a custom cell editor. when the Cell tries to validate (CellValidating event) the NewValue property is always null.
How can I get the NewValue to be set for validation?

<t:GridViewDataColumn DataMemberBinding="{Binding grade}" Header="Grade" EditTriggers="CellClick"
                        <t:GridViewDataColumn.CellEditTemplate> 
                            <DataTemplate> 
                                <ComboBox IsEditable="True" Text="{Binding grade, UpdateSourceTrigger=LostFocus, Mode=TwoWay}"/> 
                            </DataTemplate> 
                        </t:GridViewDataColumn.CellEditTemplate> 
                    </t:GridViewDataColumn> 

Nedyalko Nikolov
Telerik team
 answered on 07 Dec 2009
2 answers
90 views
Hi Every one,

I try to find a way to change the content of a cell programmaticaly.
I found this thread:http://www.telerik.com/community/forums/wpf/gridview/change-the-cell-content-at-runtime.aspx

But it doesn't work for me.

my gridview is link to a dataset. when I modify manually the value of the cell through the interface everything is fine. But if I modify it by code, nothing change.

I don't know if a dataset implement INotifyPropertyChanged but how can I have the value change by code.
I also try with using beginedit function and commitedit but still not work

.
Thank you
private void gridMain_MouseDoubleClick(object sender, MouseButtonEventArgs e)  
        {  
 
            GridViewCell currentCell = (GridViewCell) gridMain.CurrentCell;  
 
            if (currentCell.DataColumn.DisplayIndex > 17)  
            {  
                  
                if (currentCell.Foreground == Brushes.Red)  
                {  
                    currentCell.Foreground = Brushes.Black;  
                    currentCell.Value = currentCell.Value.ToString().Replace("*""");  
                }  
                else 
                {  
                    currentCell.Foreground = Brushes.Red;  
                    currentCell.Value = currentCell.Value.ToString() + "*";  
                                                             
                      
                }  
      
            }  
              
        } 
regis
Top achievements
Rank 1
 answered on 04 Dec 2009
1 answer
116 views
Hi..
Do you have any examples of binding a combo box to a grid with multiple columns.  Specially - I'm trying to set the ItemSource of the combo box to 3 columns of values in code.

How do I also set the ComboBox's Item source

var query = from c in this.DataContext.Customers
      orderby c.Name
      select c;



this.cmbCustomers.ItemSource =  query.ToList()        <-- This doesn't work... 

thanks again

Pavel Pavlov
Telerik team
 answered on 04 Dec 2009
0 answers
199 views
Does anyone know why you would get an error such as this when it is obvious that the cast should work?

[A]Telerik.Windows.Controls.RadGridView cannot be cast to [B]Telerik.Windows.Controls.RadGridView. Type A originates from 'Telerik.Windows.Controls.GridView, Version=2009.3.1127.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'LoadNeither' at location 'D:\Users\Tommy\Documents\Visual Studio 2010\Projects\MyCards.LightSpeed3\bin\Debug\plugins\Telerik.Windows.Controls.GridView.dll'. Type B originates from 'Telerik.Windows.Controls.GridView, Version=2009.3.1127.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' in the context 'Default' at location 'D:\Users\Tommy\Documents\Visual Studio 2010\Projects\MyCards.LightSpeed3\bin\Debug\Telerik.Windows.Controls.GridView.dll'.  Error at object 'Telerik.Windows.Controls.RadGridView' in markup file 'MyCards.Material;component/takeoffmanager.xaml'.

------------------------------------------------------------------------------

Wait I just found it but I will finish this post in case someone else finds it useful.
 I have some DLLs that are dynamically loaded (as plugins) This error occurs when you have copies of the same DLL in the Load paths.  To solve this I simply set Copy Local property of the Reference to False in the Plugin Project.
(you will have to do this every time you update references to new versions of DLLs in your project. I hope VS 2010 allows easier updating of References in Projects or even Solution Wide Reference Updating. If not maybe a JustCode feature)



MiddleTommy
Top achievements
Rank 1
 asked on 04 Dec 2009
1 answer
98 views
Dear Teleric team,

I am using Animating Expander control on my page whose name is Doctor Dashboard.
Inside Animating Expander, I have put a stack panel which further contains another reference control Patient Banner.

I want to name PatientBanner so that i may access this control in my Doctor Dashboard page.

I am unable to name it, coz animation expander cannot accept any name, niether can the stack panel in which the reference control for Patient Banner can accept any name.

My XAML code is as follows.

Pls tell me any naming option or any other alternative.

Urgent.


<

 

ReferenceControls:AnimatingExpanderControl InitialExpandedLength="180" Margin="0" Style="{StaticResource AnimatingExpanderControlStyle}" ExpandDirection="Up" Title="Patient Info" Background="White" Grid.Row="0" >

 

 

 

<!--<Viewbox Stretch="Uniform">-->

 

 

 

<StackPanel Orientation="Vertical" >

 

 

 

<ReferenceControls:PatientBanner x:Name="test"/>

 

 

 

</StackPanel>

 

 

 

<!--</Viewbox>-->

 

 

 

</ReferenceControls:AnimatingExpanderControl>

 


Valentin.Stoychev
Telerik team
 answered on 04 Dec 2009
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?