Telerik Forums
UI for WPF Forum
5 answers
1.4K+ views
I'm trying to add a combobox column to a RadGridView. My code is below. When I run it, I don't see the combo box.

 

<telerik:RadGridView x:Name="grdData"
                        Grid.Row="5"
                        Grid.Column="1"
                        Grid.ColumnSpan="10"
                        Margin="5"
                        AlternationCount="2"
                        AlternateRowBackground="LightBlue"
                        AutoGenerateColumns="False"
                        RowDetailsVisibilityMode="VisibleWhenSelected"
                        ItemsSource="{Binding GridData}">
  
    <telerik:RadGridView.Columns>
        <telerik:GridViewComboBoxColumn x:Name="cboGrid"
                                        ItemsSource="{Binding GridData}"
                                        Width="75">
  
            <telerik:GridViewComboBoxColumn.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=PartNo}" Margin="4,0"/>
                        <TextBlock Text="{Binding Path=Descripton}" Margin="4,0"/>
                    </StackPanel>
                </DataTemplate>
            </telerik:GridViewComboBoxColumn.ItemTemplate>
                              
        </telerik:GridViewComboBoxColumn>
  
        <telerik:GridViewDataColumn DataMemberBinding="{Binding PartNo}" Header="Part #"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Quantity}" Header="Quantity"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Descripton}" Header="Descripton"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Markup}" Header="Markup" TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding LineCost}" Header="Line Cost" TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerCost}" Header="Customer Cost" TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding LineList}" Header="Line List" TextAlignment="Right"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ExtendedPrice}" Header="Extended Price" TextAlignment="Right"/>
    </telerik:RadGridView.Columns>
  
</telerik:RadGridView>

Maya
Telerik team
 answered on 13 Oct 2011
1 answer
67 views

I have two problem in  BubbleSeriesDefinition
1. in bubble series chart for AxisX ->  MinValue="40" MaxValue="200" Step="10",
    and i have filled chart area as below:
  
 but, it make distance before and after.

2. minor gap to fill MarkedZone as i have shown in 1st picture.
Evgenia
Telerik team
 answered on 13 Oct 2011
0 answers
141 views
i want to fire wpf grid view row double click event

Html code is:

  <UI:MaestroGridView  x:Name="GrdIncomingIrpts"
                                 ShowGroupPanel="False"
                                 AutoGenerateColumns="False"
                                 FontSize="11">
                <UI:MaestroGridView.Columns>
                    <telerik:GridViewDataColumn  Header="Import Date"
                                                 HeaderTextAlignment="Center"
                                                 DataMemberBinding="{Binding rpt_date}"
                                                 Width="120" />
                    <telerik:GridViewDataColumn  Header="Employer"
                                                 HeaderTextAlignment="Center"
                                                 DataMemberBinding="{Binding empl_full_name}"
                                                 Width="150" />
                    <telerik:GridViewDataColumn  Header="Report"
                                                 HeaderTextAlignment="Center"
                                                 DataMemberBinding="{Binding map_title}"
                                                 Width="*" />
                    <telerik:GridViewDataColumn  Header="Status"
                                                 HeaderTextAlignment="Center"
                                                 DataMemberBinding="{Binding status}"
                                                 Width="120" />
                </UI:MaestroGridView.Columns>
            </UI:MaestroGridView>

binding code is:
    Dim IrptsObj As New IrptsMethods()
            GrdIncomingIrpts.ItemsSource = IrptsObj.fnGetIncomingIrpts()





vikas gupta
Top achievements
Rank 1
 asked on 13 Oct 2011
1 answer
111 views
I am trying to add ranges to a Radial Gauge.  Code snippet:
RangeList oRangeList = new RangeList();
double nextRangeMinimum = 0;
                     
foreach ( QualitativeRange oRange in _ViewModel.BulletGraphRanges )
{
    RadialRange oRadialRange = new RadialRange();
    oRadialRange.Min = nextRangeMinimum;
    oRadialRange.Max = nextRangeMinimum = oRange.Value;
    oRadialRange.BorderBrush = oRange.Brush;
    oRangeList.Add( oRadialRange );
}


The problem is that RangeList has no .Add member.  How do I add ranges to a RangeList?
Thanks.
Dan

Nevermind.  Duh.  It's oRangeList.Items.Add
All better now.

Dan
Andrey
Telerik team
 answered on 13 Oct 2011
1 answer
163 views
Hi,

I have a GridViewComboBoxColumn which is bound to a List of object with DisplayMemberPath and SelectedValueMemberPath set to the Name and ID properties of this object resp.

This combobox allows to enter text and I need it to accept user entered values which are not even present in its ItemSource.

Is it possible by any means?

Thanks,
Arpit
Maya
Telerik team
 answered on 13 Oct 2011
2 answers
165 views

I am trying to mask out negative numbers while using RadMaskedNumericInput.  There was a thread on setting ext:MaskedInputExtensions.minimum="0" and that works great for us.  We have about 50 RadMaskedNumericInput instances, so I added the following to our style resource xaml for RadMaskedNumericInput:

 

    <Setter Property="ext:MaskedInputExtensions.Minimum" Value="0" />
I am now getting the following exception:
        {"'Set property 'System.Windows.Setter.Property' threw an exception.' Line number '1423' and line position '10'."}
        {"Value cannot be null.\r\nParameter name: property"}

Can this property be in the style resource XAML?  If so, how should that be specified?  Any advise would be appreciated.

Thanks,
-Milt

 

Milt
Top achievements
Rank 1
 answered on 12 Oct 2011
1 answer
176 views
I'm adding MapPinPoint objects to the map but every time map tries to focus the newly added pinpoint and therefore pans the map.
I don't want this behavior so how we can prevent it from automatically panning to the newly added location?
Andrey
Telerik team
 answered on 12 Oct 2011
6 answers
371 views
Hallo,

i have a problem with a RadComboBox. It's ItemsSource is an ObservableCollection<ThemeInfo>. The RadComboBox is a part of a RadRibbonBar. I bound my RibbonBarViewModel to the RadRibbonBar's DataContext property.

Here is the xaml code for my RadComboBox:

<telerik:RadComboBox
                            Name="themesRadComboBox"
                            Width="100" 
                            ItemsSource="{Binding ThemeInfos}"
                            SelectedItem="{Binding SelectedThemeInfo, Mode=TwoWay}"
                            Command="{Binding ChangeApplicationThemeCommand}"
                            DisplayMemberPath="DisplayName">
                        </telerik:RadComboBox>

If i select an item it works fine, but if i do this the second time, DropDownList of RadComboBox stays closed. If the RadComboBox has focus and i use the arrow keys it also works as expected. Any ideas to solve this?
Odd Veibust
Top achievements
Rank 1
 answered on 12 Oct 2011
1 answer
313 views

I need to trim the text the item labels of the x axis to the same width as the bars of my chart. Some of the labels could be quite long, so the end of one label could overlap the beginning of the next (Note: I don’t want to rotate these labels). It also needs to be able to resize if the window size changes or if the amount of bars changes.

 

On my template I have set the texttrimming to use CharacterEllipsis, but obviously this only works if the width is set. So I would like to bind the width of the x axis label to the ActualWidth of the Bar (or Candle).

 

Using Snoop I can see the ActualWidth of PART_MainContainer and a few other PART_ containers that change size with the size of window. So how do I bind to one of these PART_s? If this can be achieved using just XAML that would be great. I don’t really have code behind skills.

This is what I have so far;

>>>> x-axis label style

<Style x:Key="AxisXLabel2D" TargetType="{x:Type telerik:AxisLabel2D}">
    <Setter Property="ItemLabelStyle">
        <Setter.Value>
            <Style TargetType="TextBlock">
                <Setter Property="Foreground" Value="DarkGoldenrod" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="TextTrimming" Value="CharacterEllipsis" />
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="Padding" Value="8,1,8,5" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="TextTrimming" Value="None" />
                        <Setter Property="FontWeight" Value="DemiBold" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:AxisLabel2D}">
                <Border x:Name="border" BorderThickness="1" BorderBrush="Transparent" CornerRadius="5,2,5,2"
                        Width="{Binding ElementName=PART_MainContainer, Path=ActualWidth}">
                    <TextBlock x:Name="labeltext" Style="{TemplateBinding ItemLabelStyle}">
                    <TextBlock.LayoutTransform>
                        <RotateTransform />
                    </TextBlock.LayoutTransform>
                    <TextBlock.Text>
                        <Binding>
                            <Binding.Converter>
                                <telerik:LabelFormatConverter />
                            </Binding.Converter>
                        </Binding>
                    </TextBlock.Text>
                    </TextBlock>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="BorderBrush" Value="LightGray" TargetName="border"  />
                        <Setter Property="Background" Value="White" TargetName="border" />
                        <Setter Property="Panel.ZIndex" Value="99999" />
                        <Setter Property="Padding" Value="8,3,8,3" TargetName="labeltext" />
                        <Setter Property="Width" Value="Auto" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

>>>>> RadChart
<telerik:RadChart x:Name="radChart">
            <telerik:RadChart.DefaultView>
                <telerik:ChartDefaultView>
                    <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea SmartLabelsEnabled="True" EnableAnimations="False">
                            <telerik:ChartArea.DataSeries>
                                <telerik:DataSeries>
                                    <telerik:DataPoint YValue="45" XCategory="Subject 01" />
                                    <telerik:DataPoint YValue="48" XCategory="Subject 02" />
                                    <telerik:DataPoint YValue="53" XCategory="Subject 03" />
                                    <telerik:DataPoint YValue="41" XCategory="Subject 04" />
                                    <telerik:DataPoint YValue="32" XCategory="Subject 05" />
                                    <telerik:DataPoint YValue="28" XCategory="Subject 06" />
                                    <telerik:DataPoint YValue="63" XCategory="Subject 07" />
                                    <telerik:DataPoint YValue="74" XCategory="Subject 08" />
                                    <telerik:DataPoint YValue="77" XCategory="Subject 09" />
                                    <telerik:DataPoint YValue="85" XCategory="Subject 10" />
                                    <telerik:DataPoint YValue="89" XCategory="Subject 11" />
                                    <telerik:DataPoint YValue="80" XCategory="Subject 12" />
                                </telerik:DataSeries>
                            </telerik:ChartArea.DataSeries>
                        </telerik:ChartArea>
                    </telerik:ChartDefaultView.ChartArea>
                </telerik:ChartDefaultView>
            </telerik:RadChart.DefaultView>
        </telerik:RadChart>

>>>>> The code behind that styles the chart
public MainWindow()
        {
            this.InitializeComponent();
 
            this.radChart.DefaultView.ChartArea.Loaded += ChartArea_Loaded;
 
            // Insert code required on object creation below this point.
             
        }
        void ChartArea_Loaded(object sender, RoutedEventArgs e)
        {
            ChartArea area = sender as ChartArea;
            HorizontalAxisLabels2D axisLabelsContainer = area.FindChildByType<HorizontalAxisLabels2D>();
            var axisLabels = axisLabelsContainer.ChildrenOfType<AxisLabel2D>();
            System.Windows.Style style = this.Resources["AxisXLabel2D"] as System.Windows.Style;
 
            foreach (var item in axisLabels)
            {
                item.Style = style;
            }
        }


Secondly, (not really a problem, but I thought I'd ask as I'm here!) Does anyone know how to make it so the CharacterEllipsis (or whatever ellipsis), could appear in the center of the word, not at the end?

For example, a full width label "Test Subject 001", trimmed to say "Test Subje..." is ok, but in this case it would be better if it said "Test Su...001".  I know it's probably not the right place to post this, but any help would be great. Does anything in the RadControls do this?

Thank you in advance.


Evgenia
Telerik team
 answered on 12 Oct 2011
1 answer
107 views
Hi,
is it possible, that the binding to the itemssource is broken in the latest internal build. I have updated my controls and suddendly the tileview won't show any tiles.I'm using an Observable Collection with custom classes as ItemsSource and a ItemContainerStyle.

Are there any changes in the latest build?
Tina Stancheva
Telerik team
 answered on 12 Oct 2011
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?