Telerik Forums
UI for WPF Forum
1 answer
205 views
I use the chart to display some data, but the labels can become very long.
Now I want to use the Default LabelFormat but I do not seem to get it work

I use the following      #LABEL{[a-zA-Z]{0,10}...}

But my string always stays as long as it is. I want the string to be a max of 15 chars and if longer have the tree dots after it
Velin
Telerik team
 answered on 18 Aug 2009
1 answer
231 views
I'm adding items to a treeview programmatically and have set the tag property to a unique value.  How can I loop the items and when I come to my value select the item and then exit the loop.  I'm using


 

For Each item As RadTreeViewItem In RadTreeView1.Items

 

 

If CInt(item.Tag) = 3 Then

 

item.IsSelected =

True

 

 

Exit For

 

 

End If

 

 

Next

However I need to get the child items to the first treeview item

Thanks

 

Valentin.Stoychev
Telerik team
 answered on 18 Aug 2009
2 answers
126 views
I need to get the value of the selectedItem NumeroIncidencia column, I looked at the examples and following the steps that detail does not work, I can help.

Thank you.

 

A simulation code to see what I'm doing

<Grid>   
    <Button Height="36" HorizontalAlignment="Right" Margin="0,11,177,0" Name="cmdBuscar" VerticalAlignment="Top" Width="36">   
        <Image Source="iconos/buscar.gif" Name="Image5" />   
    </Button>   
    <ListBox Height="100" Margin="0,40,245,0" Name="ListBox1" DisplayMemberPath="NumeroIncidencia" VerticalAlignment="Top" />   
    <telerik:RadGridView x:Name="BuscarGrid" Margin="0,160,0,0" AutoGenerateColumns="False">   
        <telerik:RadGridView.Columns >   
            <telerik:GridViewDataColumn IsReadOnly="True" Header="Numero Incidencia" UniqueName="NumeroIncidencia" Width="150"/>   
            <telerik:GridViewDataColumn IsReadOnly="True" Header="Procedencia" UniqueName="DescripcionProcedencia" Width="120"/>   
            <telerik:GridViewDataColumn IsReadOnly="True" Header="Observaciones" UniqueName="Observaciones" Width="300"/>   
        </telerik:RadGridView.Columns>   
    </telerik:RadGridView>   
</Grid> 
 
 
Private Sub cmdBuscar_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles cmdBuscar.Click   
    Dim rd As New ReturnData.ReturnDataSoapClient   
    Dim ds As DataSet   
    ds = rd.ReturnDataset("SELECT NumeroIncidencia, DescripcionProcedencia,  Observaciones FROM Incidencias")   
    Me.BuscarGrid.ItemsSource = ds.Tables(0)   
    Me.ListBox1.ItemsSource = Me.BuscarGrid.SelectedItems   
End Sub   
 
I have no ListBox1 in the desired value
Carles Vazquez
Top achievements
Rank 1
 answered on 17 Aug 2009
0 answers
72 views

 

 

 

 Resolved.

Hemal
Top achievements
Rank 1
 asked on 17 Aug 2009
3 answers
128 views
I can display the data how I want it with my custom column headers and such. However, I have some columns in my child tables I'd like to have aggregates on and display in a footer in the child table. Can this be done?

Thanks,
Byron
Vlad
Telerik team
 answered on 17 Aug 2009
3 answers
261 views
Hello,
I'm having troubles with the aggregate functions. On the examples that I have found when you group a column the collapsed row has whatever caption is on the GroupFooters and they seem to be left justified.
on the one I'm working with they display but they seem to be pushed to the right. I can't seem to find a way to position them to the left.

<telerik:RadGridView   
                Name="rgv"    
                Grid.Row="1"   
                Margin="10,5,10,5" 
                telerik:StyleManager.Theme="Office_Blue"   
                ShowColumnFooters="True"   
                ShowGroupFooters="True" 
                IsReadOnly="True"   
                AutoGenerateColumns="False" 
                ColumnsWidthMode="Auto" 
                ItemsSource="{Binding Source={StaticResource DataProvider}}">  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn Header="ID" DataMemberPath="ID"  > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:CountFunction Caption="Count:" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Desc" DataMemberPath="Desc"  /> 
                    <telerik:GridViewDataColumn Header="Purchase Date" DataMemberPath="Purch_Date"  DataFormatString="{}{d}" /> 
                    <telerik:GridViewDataColumn Header="Purchase Price" DataMemberPath="Purch_Price" DataFormatString="{}{0:c}" > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:SumFunction Caption="Sum:" ResultFormatString="{}{0:c}" SourceField="Purch_Price" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Disposal Date" DataMemberPath="Disp_Date" DataFormatString="{}{d}" /> 
                    <telerik:GridViewDataColumn Header="Disposal Price" DataMemberPath="Disp_Price" > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:SumFunction Caption="Disp Sum:" ResultFormatString="{}{0:c}" SourceField="Disp_Price" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Type" DataMemberPath="Type" /> 
                    <telerik:GridViewDataColumn Header="Tax" DataMemberPath="Tax" /> 
                    <telerik:GridViewDataColumn Header="Status" DataMemberPath="Status" /> 
                    <telerik:GridViewDataColumn Header="Property Type" DataMemberPath="Property_Type" /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 

After grouping the type column i get somthing like
1503                                                           |  Count: 56                        |  Sum: $1,978.1     and the rest is cut off

Thanks much,
~Boots
Missing User
 answered on 14 Aug 2009
7 answers
765 views
I have a RadTreeView with HierarchicalDataTemplate as follows:

<HierarchicalDataTemplate DataType="Category" ItemsSource="{Binding XPath=Category}"
   <TextBlock x:Name="tbCategoryName" Text="{Binding XPath=@Name}" MouseRightButtonUp="tbCategoryName_MouseRightButtonUp" 
                           MouseDown="tbCategoryName_MouseDown"
   </TextBlock> 
</HierarchicalDataTemplate> 

I need access to the RadTreeViewItem so that I can call methods and properties such as BeginEdit, ExpandAll, and IsExpanded.
This is my RadTreeView declaration:

        <telerik:RadTreeView ItemsSource="{Binding Source={StaticResource CategoriesXML}}" Margin="105,64,0,0"  
                             Name="tvOntology" HorizontalAlignment="Left" VerticalAlignment="Top" Width="200" 
                             IsEditable="True" IsEnabled="True" IsExpandOnDblClickEnabled="False"  
                             IsExpandOnSingleClickEnabled="True"
        </telerik:RadTreeView> 
 
It works fine but I'm not able to get the RadTreeViewItem. Could someone tell me how, please?
Tim
Top achievements
Rank 1
 answered on 14 Aug 2009
10 answers
391 views
Hello,
I encountered a problem with the GridView WPF-Control. When I use a Converter in the DataMemberBinding of a column and group by that column, the result will be grouped by the unconverted value.

To show the problem, i set up a small test project with a small "Person" class with "Name" (string), "Age" (int) and "Status" (int) properties.
In the test project, three persons-objects will be created and bound to a GridView. Each property in a seperate column.
The "Status" column uses a converter for the DataMemberBinding:
<Window x:Class="RadGridViewColumnTest.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:System="clr-namespace:System;assembly=mscorlib"         
    xmlns:local="clr-namespace:RadGridViewColumnTest" 
    Title="Window1" Height="300" Width="300"
    <Grid> 
        <Grid.Resources> 
            <local:StatusConverter x:Key="StatusConverterResource"
            </local:StatusConverter> 
        </Grid.Resources> 
        <telerik:RadGridView x:Name="grid" AutoGenerateColumns="False" Grouping="grid_Grouping"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn HeaderText="Person" DataMemberBinding="{Binding .Name}" DataType="{x:Type System:String}"
                </telerik:GridViewDataColumn> 
                <telerik:GridViewDataColumn HeaderText="Age" DataMemberBinding="{Binding .Age}" DataType="{x:Type System:Int32}"/> 
                <telerik:GridViewDataColumn HeaderText="Status" DataMemberBinding="{Binding  Path=Status, Converter={StaticResource StatusConverterResource}}" IsSortable="True" DataType="{x:Type System:Int32}" IsGroupable="True"/> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 

public class StatusConverter : IValueConverter 
    { 
        #region IValueConverter Members 
 
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 
        { 
            if ((int)value < 256) 
            { 
                return "< 256"
            } 
            else 
                return ">= 256"
 
        } 
 
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 
        { 
            throw new NotImplementedException(); 
        } 
        #endregion 
    } 

The Status of the three persons are 122, 123, 321, and they appear correctly converted in the list.
Obviously the result, after a group by Status, should show the persons with Status 123 and 123 in one group because their Status is below 256.
But it seems the converter won't be used for grouping and every person appear in a single group.
Is there a solution for this problem ?

Thanks,  Michael
Michael
Top achievements
Rank 1
 answered on 14 Aug 2009
1 answer
66 views
Hi.
I am looking for "the right way" to add new Rows to a GridView...
1. Is there any pre-defined method to add new rows ? (Like the WinForms MS-Grid used to have...)
Something like:
AddNewRowIfUserDoubleClicksTheLeftPane="true" 

2. I am displaying some navigateable Properties which are based on Types of which I know the Interface only..
Something Like:
public class DisplayData  
{  
   public string Name { getset; }  
   public ISomeInterfaceType Prop { getset; }  
}  
  
public interface ISomeInterfaceType  
{  
   string OtherName { get; }  
}  
<telerik:GridViewDataColumn     
     Header="Name"    
     DataMemberBinding="{Binding Path=Name, Mode=OneWay}"    
     Width="2*"    
     IsReadOnly="True"/>    
<telerik:GridViewDataColumn     
     Header="Other"    
     DataMemberBinding="{Binding Path=Prop.OtherName, Mode=OneWay}"  
     DataType="{x:Type sys:String}"  
     Width="3*"    
     IsReadOnly="True"/>
However, I want to be able to let the user add new rows - in which case I need two entered strings (which I check for validity) and afterwards return the new "DisplayData"-Object. Currently I am doing this using a new Window (ShowDialog()) which let's the User input his data...

Can I use the "new-row" feature of the GridView, if some columns are bound to read-only properties or even classes of which I know only the Interface ?

Yours,
Nils


Nedyalko Nikolov
Telerik team
 answered on 14 Aug 2009
1 answer
176 views
I am unable to view the cs code - clicking the tab leaves the xaml.
Valeri Hristov
Telerik team
 answered on 14 Aug 2009
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?