Telerik Forums
UI for WPF Forum
2 answers
150 views
Hello Telerik Team,

I Converted code VB to C#. In VB it is alreday tasted & worked perfectly but in C# Rebind is not working properly.

While loading window am setting like below:

  rgvSet.ItemsSource = DataModule.objSets;
  rgvOrders.ItemsSource = DataModule.objOrderList;
  rgvTour.ItemsSource = DataModule.objTourList;
  rgvTruck.ItemsSource = (from p in DataModule.objTruckList where p.Status == DataModule.Cons_Status_Available select p).ToList<clsTruck>();
  rgvTrailer.ItemsSource = (from p in DataModule.objTrailerList where p.Status == DataModule.Cons_Status_Available select p).ToList<clsTrailer>();
        rgvDriver.ItemsSource = (from p in DataModule.objDriverList where p.Status == DataModule.Cons_Status_Available select p).ToList<clsDriver>();

"rgv... " are RadgridView and all List are ObservableCollection. After doing such operation adding/removing/updating in collection am rebinding appropriate grid. Grid which having itemsource as LINQ query will not Rebind but Grid which have collection as Itemsource will rebind correctly.

What could be a reason? any idea?

Thanks...!!!
Snehal
Top achievements
Rank 1
 answered on 19 Jul 2010
5 answers
1.0K+ views
Hi,
In our application we have a requirement in which we want to show a tree hierarchy in expanded state, we should not able to collapse it and no expander be shown.
How can we do it using RadTreeView ?

Regards,
Balaram Barange


Tina Stancheva
Telerik team
 answered on 19 Jul 2010
1 answer
88 views
Hello!
Assuming that I have 6 different SeriesMapping in a chart but in the chart's legend I want to show only 4 of them how should I do this??
I've tried to set their LegendLabel to null but this only puts the default "Series x" label in Legend which is not the desired behavior.

Thank you! 
Roxana
RoxanaC
Top achievements
Rank 1
 answered on 19 Jul 2010
2 answers
145 views
Hello,
Here is my gridview.
<UserControl x:Class="SilverlightApplication1.MainPage"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView">
    <Grid x:Name="LayoutRoot">
         
        <telerikGrid:RadGridView x:Name="RadGridView1" ItemsSource="{Binding}" AutoGenerateColumns="False">
            <telerikGrid:RadGridView.ChildTableDefinitions>
                <telerikGrid:GridViewTableDefinition/>
            </telerikGrid:RadGridView.ChildTableDefinitions>
             
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}"/>
                <telerikGrid:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
            </telerikGrid:RadGridView.Columns>
             
            <telerikGrid:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerikGrid:RadGridView x:Name="SubGrid" DataLoading="SubGrid_DataLoading"
                                             AutoGenerateColumns="False" ItemsSource="{Binding Items}">
                    </telerikGrid:RadGridView>
                </DataTemplate>
            </telerikGrid:RadGridView.HierarchyChildTemplate>
        </telerikGrid:RadGridView>
    </Grid>
</UserControl>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using Telerik.Windows.Controls;
using System.Collections.ObjectModel;
using Telerik.Windows.Data;
using Telerik.Windows.Controls.GridView;
 
namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            DataContext = from i in Enumerable.Range(0, 10)
                          select new MyObject()
                          {
                              ID = i,
                              Name = String.Format("Name{0}", i)
                          };
        }
 
        public class MyObject
        {
            public int ID { get; set; }
            public string Name { get; set; }
 
            public IEnumerable<MyObject2> Items
            {
                get
                {
                    return from i in Enumerable.Range(0, 10)
                           select new MyObject2()
                           {
                               x = i
                           };
                }
            }
        }
 
        public class MyObject2
        {
            public int x { set; get; }
 
            public IEnumerable<MyObject2> Items
            {
                get
                {
                    return from i in Enumerable.Range(0, 10)
                           select new MyObject2()
                           {
                               x = i
                           };
                }
            }
        }
 
        private void SubGrid_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            var grid = (GridViewDataControl)sender;
 
            var d = new GridViewTableDefinition();
            d.Relation = new PropertyRelation("Items");
            grid.TableDefinition.ChildTableDefinitions.Add(d);
 
            grid.AutoGenerateColumns = false;
            grid.Columns.Add(new GridViewDataColumn() { DataMemberBinding = new Binding("x") });
        }
    }
}

For the firs time it is child one and then it becomes self-hierarchical. Everything is OK, but in the real programm we use WCF service and MyObject and MyObject2 are DataContracts, and we need to call a WCF service in the get-methods of the Items property.
So, I ask you for help: How could I call the WFC method or maybe there is another way to make such hierarchy.
Jokerwolf
Top achievements
Rank 1
 answered on 19 Jul 2010
0 answers
79 views
Hi,

I have an exception with GridView in the part of using in the visual studio extention based on VSPackage described in this thread.
Any ideas about this problem?
Whether correctly I understand, what I cannot to use with the Telerik controls in the Visual Studio extensions based on VSPackage?
ifle
Top achievements
Rank 1
 asked on 18 Jul 2010
5 answers
781 views
I try to hide a row that have a specific status, When I do like the code below. the row is not shown, but there is space left "blank" in the grid where the row should be. I also tested with Height=0

private void radGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
    GridViewRow row = e.Row as GridViewRow;
    if (row != null)
    {
                 
        MyClass _MyClass = row.DataContext as MyClass;
        if (row != null && _MyClass != null)
        {
            row.IsExpandable = _MyClass.Category.Equals(5);
        }
        else
        {
            row.IsExpandable = false;
        }
 
        if (_MyClass.MediaCategory.Equals(5) && _MyClass.Status.Equals(-1))
        {
           row.Visibility = System.Windows.Visibility.Collapsed;
        }
     }
}

Any suggestions?

/Ken

Pavel Pavlov
Telerik team
 answered on 16 Jul 2010
2 answers
187 views
I am trying to export my WPF chart control to an image but I am getting an exception saying "Object reference not set". I am wondering what I am doing wrong here.
I am trying to export to xps. 
My another requirement is to convert to jpeg.
Can you guys please help me doing this?


SeriesMapping
sm1 = new SeriesMapping();
sm1.SeriesDefinition =
new LineSeriesDefinition();
sm1.LegendLabel =
"Line Series 1";
sm1.CollectionIndex = 0;
ItemMapping im1 = new ItemMapping();
im1.DataPointMember =
DataPointMember.YValue;
sm1.ItemMappings.Add(im1);
SeriesMapping sm2 = new SeriesMapping();
sm2.SeriesDefinition =
new LineSeriesDefinition();
sm2.LegendLabel =
"Line Series 2";
sm2.CollectionIndex = 1;
ItemMapping im2 = new ItemMapping();
im2.DataPointMember =
DataPointMember.YValue;
sm2.ItemMappings.Add(im2);
var itemsSource = new List<double>[] { new List<double> { 9, 2, 3, 4 }, new List<double> { 5, 7, 3, 4 } };
this.RadChart1.SeriesMappings.Add(sm1);
this.RadChart1.SeriesMappings.Add(sm2);
this.RadChart1.ItemsSource = itemsSource;
Microsoft.Win32.
SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.DefaultExt =
".xps";
string fileName = string.Empty; 

if (!((bool)dlg.ShowDialog()))
{
fileName = dlg.FileName;
}
this.RadChart1.ExportToXps(fileName);

Nikolay
Telerik team
 answered on 16 Jul 2010
1 answer
93 views
Dear ,

Please advise me the way to use SrollViewer for minimized items in 2010 Q2 version

Best Regards
Truong Pham
Ripper
Top achievements
Rank 1
 answered on 16 Jul 2010
3 answers
121 views
Ok, i have a RadTreeView with an Item Source of List<ActivityControl> which is a user control that has a text box, a canvas and a text box in it... my problem is that because the text box is within the RadTreeView whenever i try and click and drag to select text it tries to drag and drop the Selected item!?! this is going to be a pain for users to try and edit text if they cant drag to highlight....

i've uploaded a video to give you an idea!

http://www.screencast.com/users/kevinrhynas/folders/Jing/media/8fb40a9e-c5ce-4c6f-83ba-20054a6d466f

Also on a side note... i pressume that it is the header of each RadTreeItem that sets the "preview" in the draggable bit... how can i set this if i've simply set the "itemsource" to be a list.. as opposed to manually adding these items??



Tina Stancheva
Telerik team
 answered on 16 Jul 2010
1 answer
93 views
Dear Team ,
                  Please see the attached image file showing items in the tileView.When i add more items and the items in right side gets so small even i cant see the maximize,minimze buttons . any solution

Kind Regards
Asghar
Ripper
Top achievements
Rank 1
 answered on 16 Jul 2010
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
VirtualKeyboard
HighlightTextBlock
Security
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?