Telerik Forums
UI for WPF Forum
35 answers
1.0K+ views
Hello!

I am having some problems with the GridViewComboBoxColumn that is databound. In the grid I am displaying postal codes. And each postal code belongs to a country. The country column is a GridViewComboboxCOlumn (Item source is a list of countries from the DB - Linq2SQL). Now I have 2 problems.
The fist is that the column Country is empty until I start scrolling (am I missing something?).

The second is that the scrolling is very slow. If I don't use the combobox the grid is fast again.Is there any way to make it faster?

I would also like to filter this column, but it only offers me ContryID's.  But if you use Contry.Name as DataMemberBinding, the Grid
updates all the Countries with the same name..


XAML:
<Window x:Class="WPF_LinQ.Forms.Glavno" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Glavno" Height="800" Width="600" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
        > 
    <Grid> 
        <telerik:RadGridView Margin="5" Name="radGridView1" AutoGenerateColumns="False" CanUserReorderColumns="False" ColumnsWidthMode="Fill"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn HeaderText="Code" UniqueName="ID" /> 
                <telerik:GridViewDataColumn HeaderText="City" UniqueName="Name" /> 
                <telerik:GridViewComboBoxColumn  
                    ItemsSource="{Binding}"  
                    DataMemberBinding="{Binding Path=CountryID}"   
                    DisplayMemberPath="Name"  
                    SelectedValueMemberPath="ID"  
                    HeaderText="Country"  
                    UniqueName="CountryID" />             
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 

CS:
 public partial class Glavno : Window 
    { 
        private DB.TMSDataContext m_DC; 
        public Glavno() 
        { 
            InitializeComponent(); 
            Init();  
        } 
      
 
        public void Init() 
        { 
            m_DC = new DB.TMSDataContext(); 
            radGridView1.Columns[2].DataContext = m_DC.Countries; 
            radGridView1.ItemsSource = m_DC.PostalCodes.OrderBy(e=>e.Name); 
            //radGridView1.Columns[3].DataContext = m_DC.PostalCodes.OrderBy(p => p.Name).ToArray(); 
            //radGridView1.Columns[2].DataContext = GetCountries(); 
                            
        } 
    } 


Thanks!

p.s. Yes I have looked at the demos example and it didn't help :-/
Pavel Pavlov
Telerik team
 answered on 18 Apr 2012
1 answer
93 views
Hi,
we want to buy the new version of telerik controls because we are interested in RichTextEditor and PdfViewer for WPF.
We have some question before decide:
Is it possible to :
- convert review of text selection in highlight text when the document is converted in pdf?
- decide witch part of document is editable? We need to define some read only region in document.
- insert existing document as attachment of principal document? We need to embed other pdf documents. We know that in pdf is possible and we have do with iTextSharp. If is not allowed, is it possible to insert custom xaml tag to intercept the pdf generation and manage with our procedure?

Thanks
Iva Toteva
Telerik team
 answered on 18 Apr 2012
2 answers
82 views
Hi,

Although I am not
a Telerik user, I like to watch the news, and I encountered a problem while using the control RadDataForm in conjunction with the application theme Expression_DarkTheme.

In this situation the DataFormComboBoxField´s property DisplayMemberPath doesn´t work. Following your project 318767_RadGridView-WPF-AR-140 in this forum, I add a line in the MainWindow.xaml.cs constructor:
public MainWindow()
        {
            StyleManager.ApplicationTheme = new Expression_DarkTheme();
             
            InitializeComponent();
        }

After that the values are no longer displayed, only the object's name. When I select one, the value is displayed correctly.

Best Regards,

Sergio
Sergio
Top achievements
Rank 1
 answered on 18 Apr 2012
1 answer
110 views
Hi,
I was wondering if there's a way (with RadScheduler or RadSchedulerView for WPF) of resizing a day column in WeekView by clicking on its header and dragging it.

Thanks in advance.
Yana
Telerik team
 answered on 18 Apr 2012
2 answers
164 views
Good morning

I'm using RadFilter to compose custom filters so my GridView has its IsFilteringAllowed property set to false.
is this the right way to hide the funnel icon in WPF?
In SL it works fine this way but in WPF the icon remains there...

Thanks in advance.
Martin


Martin Durao
Top achievements
Rank 1
 answered on 18 Apr 2012
2 answers
147 views
Hi,

I am using 2 nested collections in a graph, the first of which contains 3 series of identical length (x ranges from 0-220) and the second collection has 1 series that ranges from 0-450 in x values. In other words, my two collections do not have the same amount of points in them.

When I display the graph, all is fine except when I start using the ZoomScrolling feature. I use the default sampling of 200 points but when I zoom between x=100-240 the 200 sample points are all on the left side for the first 3 collections and all on the right side for the last collection. There are no points in the middle! The first three collections should be spread out between 100 and 220 and the last collection should have its samples spread out evenly across the zoomed part of the screen (see attached snapshot of full graph and zoomed part of graph).

Is this a known issue? Is there a workaround? I am using 2011.2.920.35 in Visual Studio 2010 in a WPF project.

Thanks
Yavor
Telerik team
 answered on 18 Apr 2012
17 answers
357 views
Has there been any consideration for creating a WPF &\or Silverlight version of the infamous PropertyGrid?  I think this would be a very useful control to have in your arsenal.

-Lee
Ivan Ivanov
Telerik team
 answered on 18 Apr 2012
1 answer
105 views
When I change a radribbonview control's theme ,RadRibbonGallery lost its scroll bar and button. Any suggestions?
first capture image is before use theme, second is after use theme.

code:       
         Theme ConvertToTheme(string themeName)
        {
            if (string.IsNullOrWhiteSpace(themeName))
                return new Windows7Theme();
            return (Theme)typeof(Theme).Assembly.CreateInstance(string.Format("Telerik.Windows.Controls.{0}Theme", themeName));
        }
    

        void SetGlobalTheme(Theme theme)
        {
            StyleManager.ApplicationTheme = theme;
            StyleManager.SetTheme(radRibbonView1, theme);

        }

        private void RadRibbonRadioButton_Click(object sender, RoutedEventArgs e)
        {
            RadRibbonRadioButton radioButton = (RadRibbonRadioButton)sender;
            Theme currentTheme = ConvertToTheme(radioButton.Text);//Button's content is theme name, like Office_Silver
            SetThemeToAllViews(currentTheme);
        }


Miro Miroslavov
Telerik team
 answered on 18 Apr 2012
3 answers
406 views
Hi I use DataFormatString  property in my gridColumn
thr problem is that when the number is negative
the minus is in the right side of the number instead of the left size
my grid is set to be RightToLeft cause its hebrew
this is my code

<GroupBox Name="gbAccountManagment" Margin="2,2,2,2" MaxHeight="580" Height="480" VerticalAlignment="Top" > 
                <GroupBox.Header> 
                    <Grid> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition></ColumnDefinition>  
                            <ColumnDefinition></ColumnDefinition>  
                        </Grid.ColumnDefinitions> 
                        <Button Grid.Column="0" Name="btnAccountManagmentPlus" Visibility="Hidden" Width="20" Click="btnAccountManagmentPlus_Click">+</Button> 
                        <Button Grid.Column="0"  Name="btnAccountManagmentMinus"  Width="20" Click="btnAccountManagmentMinus_Click">-</Button> 
                        <Label Grid.Column="1">ניהול חשבונות</Label> 
                    </Grid> 
                </GroupBox.Header> 
                <StackPanel> 
                    <StackPanel Orientation="Horizontal">  
                        <TextBlock Margin="100,5,5,5" FontWeight="Bold" Width="60">סוג תקציב</TextBlock> 
                        <ComboBox Name="cmbBudgetType" DisplayMemberPath="Name" Margin="5,5,5,5" Width="120" SelectionChanged="cmbBudgetType_SelectionChanged"></ComboBox> 
                        <TextBlock Margin="100,5,5,5" FontWeight="Bold" Width="60">סוג פעילות</TextBlock> 
                        <ComboBox Name="cmbActivityType" DisplayMemberPath="Name" Margin="5,5,5,5" Width="120" SelectionChanged="cmbActivityType_SelectionChanged"></ComboBox> 
                        <Button Name="btnFilter" Margin="30,5,5,5" Click="btnFilter_Click">הצג</Button> 
                        <Button Visibility="Hidden" Name="btnTry" Margin="30,5,5,5" Click="btnTry_Click">Try</Button> 
                    </StackPanel> 
                     <telerik:RadGridView Name="gvAccount" Margin="5,5,5,5" AutoGenerateColumns="False"   
                                         CanUserResizeColumns="False" CanUserReorderColumns="False"   
                                         CanUserFreezeColumns="False" ShowGroupPanel="False" CanUserSortColumns="False" 
                                         FlowDirection="RightToLeft" IsFilteringAllowed="False" ShowColumnHeaders="True" CanUserInsertRows="False">  
                        <telerik:RadGridView.Resources> 
                            <Style x:Key="ToolTipColumnStyle" TargetType="telerik:GridViewCell">  
                                <Setter Property="ToolTip" Value="{Binding Content,RelativeSource={RelativeSource Self}}" /> 
                            </Style> 
                        </telerik:RadGridView.Resources> 
                            <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="BudgetTypeName" Header="תקציב"  Width="60"/>  
                            <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="Name" Header="שם חשבון/&#13;סעיף/תת סעיף"  Width="160" CellStyle="{StaticResource ToolTipColumnStyle}"/>                                  
                            <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="DisplayNum" Header="מס' חשבון/&#13;סעיף/תת סעיף" Width="110" /> 
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00}" UniqueName="TotalBudget" Header="הקצבה&#13;כוללת&#13;(אש''ח)"  Width="75"/>  
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="BalanceBudgetAllocation" Header="יתרה&#13;לתקצוב&#13;(אש''ח)" Width="75" /> 
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="SumBudgetRequest" Header="שריון &#13;לפעילויות&#13;(אש''ח)" Width="75"/>  
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="SumOrderAllocation" Header="התחייבות&#13;לפעילויות&#13;(אש''ח)" Width="75" /> 
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="SumOrderPaid" Header="שולם&#13;בפועל&#13;(אש''ח)"  Width="75"/>  
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="BalanceToPay" Header="יתרה&#13;לתשלום&#13;(אש''ח)" Width="75"/>  
                            <telerik:GridViewDataColumn IsReadOnly="True" DataFormatString="{}{0:#,##0.00₪}" UniqueName="ActivityTypeName" Header="סוג&#13;פעילות" Width="120"/>  
                        </telerik:RadGridView.Columns> 
..........


one more thing,
I'll thank you if you can give me an example of how to arange my controls
inside a GroupBox
so that the scrolls of my grid will not get crazy...

Lavanya
Top achievements
Rank 1
 answered on 18 Apr 2012
1 answer
137 views
Hello Telerik Team! I'm working on WPF Project using Telerik Controls. My goal is to build an application for a Medic Clinic, and this app must run on a pendrive, so we are using MS Access as Database. I'm having problems to bind ScheduleView to Access Database.



Before I sent  this post, have you sure I had tried different ways to solve this problem. So, direct to the point, when I try to Insert or Update an Appointment (CustomAppointment), I always receive an syntax error in INSERT INTO or UPDATE statement. The error is raised because DateTime format of Start/End properties from ScheduleView. I'm using a OleDBCommand with Parameters, as you see below.



I already tried pass date/time values surrounded with single quotes, double quotes, sharp (#), and DateTime as you can se in this code. Also I tried OleDbType.DBDate. OleDbType.Date and OleDbType.DBTimeStamp. But always got the same Syntax Error in INSERT INTO.



Could you please help me?

protected override void OnAppointmentCreated(IAppointment appointment)

{

CustomAppointment addedAppointment = appointment as CustomAppointment;

if (addedAppointment != null)

{

OleDbConnection cnInsertAppointment = new OleDbConnection(Properties.Resources.cnDBPhito);

cnInsertAppointment.Open();

OleDbCommand cmdInsertAppointment = new OleDbCommand();

cmdInsertAppointment.Connection = cnInsertAppointment;

cmdInsertAppointment.CommandType = CommandType.Text;

cmdInsertAppointment.CommandText = "insert into Appointments(AppointmentID, Subject, Body, Start, End, IsAllDayEvent, Location, Url, TimeMarker, Importance, Category, RecurrencePattern, IsReturn, MedicalOrder, HealthClubID, PatientID) values(@AppointmentID, @Subject, @Body, @Start, @End, @IsAllDayEvent, @Location, @Url, @TimeMarker, @Importance, @Category, @RecurrencePattern, @IsReturn, @MedicalOrder, @HealthClubID, @PatientID)";

cmdInsertAppointment.Parameters.Add("@AppointmentID", OleDbType.VarChar, 36).Value = addedAppointment.UniqueId;

cmdInsertAppointment.Parameters.Add("@Subject", OleDbType.VarChar, 100).Value = addedAppointment.Subject;

cmdInsertAppointment.Parameters.Add("@Body", OleDbType.VarChar, 400).Value = addedAppointment.Body;

DateTime dtStart = new DateTime(addedAppointment.Start.Year, addedAppointment.Start.Month, addedAppointment.Start.Day, addedAppointment.Start.Hour, addedAppointment.Start.Minute, addedAppointment.Start.Second);

cmdInsertAppointment.Parameters.Add("@Start", OleDbType.DBTimeStamp).Value = dtStart;

DateTime dtEnd = new DateTime(addedAppointment.End.Year, addedAppointment.End.Month, addedAppointment.End.Day, addedAppointment.End.Hour, addedAppointment.End.Minute, addedAppointment.End.Second);

cmdInsertAppointment.Parameters.Add("@End", OleDbType.DBTimeStamp).Value = dtEnd;

cmdInsertAppointment.Parameters.Add("@IsAllDayEvent", OleDbType.Boolean).Value = addedAppointment.IsAllDayEvent;

cmdInsertAppointment.Parameters.Add("@Location", OleDbType.VarChar, 200).Value = addedAppointment.Location;

cmdInsertAppointment.Parameters.Add("@Url", OleDbType.VarChar, 200).Value = addedAppointment.Url;

cmdInsertAppointment.Parameters.Add("@TimerMarker", OleDbType.VarChar, 50).Value = addedAppointment.TimeMarker == null ? String.Empty : addedAppointment.TimeMarker.TimeMarkerName;

cmdInsertAppointment.Parameters.Add("@Importance", OleDbType.VarChar, 50).Value = addedAppointment.Importance == null ? String.Empty : addedAppointment.Importance.ToString();

cmdInsertAppointment.Parameters.Add("@Category", OleDbType.VarChar, 50).Value = addedAppointment.Category == null ? String.Empty : addedAppointment.Category.CategoryName;

if (addedAppointment.RecurrenceRule != null)

{

cmdInsertAppointment.Parameters.Add("@RecurrencePattern", OleDbType.VarChar, 100).Value = RecurrencePatternHelper.RecurrencePatternToString(appointment.RecurrenceRule.Pattern);

}

cmdInsertAppointment.Parameters.Add("@IsReturn", OleDbType.Boolean).Value = addedAppointment.IsReturn;

cmdInsertAppointment.Parameters.Add("@MedicalOrder", OleDbType.Boolean).Value = addedAppointment.MedicalOrder;

cmdInsertAppointment.Parameters.Add("@HealthClubID", OleDbType.Integer).Value = addedAppointment.HealthClubID;

cmdInsertAppointment.Parameters.Add("@PatientID", OleDbType.Integer).Value = addedAppointment.PatientID;

try

{

cmdInsertAppointment.ExecuteNonQuery();

}

catch (Exception ex)

{

Console.WriteLine(ex.Message.ToString());

}

cmdInsertAppointment.Dispose();

cnInsertAppointment.Close();

cnInsertAppointment.Dispose();

}

}







I'm using VS2010 + SP1, WPF Application, Target .NET Framework 3.5, Access 2007 Database (mdb) and Telerik WPF Controls Q1 2012.
Carlos Mattos
Top achievements
Rank 2
 answered on 17 Apr 2012
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?