Telerik Forums
UI for WPF Forum
4 answers
491 views
I'm able to get items from a database into a combobox, but it's querying way too much data. Also, the selected item isn't displaying the string I expected. Instead, it's showing the object type as a string. I clearly don't understand something and I'm stuck even though I'm following this.

Database table name = CityCountyState, e.g.

City      County     State
--------- ---------  ---------
City1     County1    State1
City1     County2    State1
City2     County3    State2
City3     County4    State3


A city can be in more than one county, which is why I want to use a complex data template:

01.<DataTemplate x:Key="ComboBoxCustomTemplate">
02.  <Grid Margin="0,2,0,2">
03.    <Grid.ColumnDefinitions>
04.      <ColumnDefinition />
05.      <ColumnDefinition />
06.    </Grid.ColumnDefinitions>
07.    <Grid.RowDefinitions>
08.      <RowDefinition />
09.      <RowDefinition />
10.    </Grid.RowDefinitions>
11.    <TextBlock TextAlignment="Left" Grid.ColumnSpan="2" Text="{Binding City}" />
12.    <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
13.      <TextBlock Text="County: " />
14.      <TextBlock Foreground="Blue" Text="{Binding County}" />
15.    </StackPanel>
16.    <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
17.      <TextBlock Text="State: " />
18.      <TextBlock Foreground="Blue" Text="{Binding State}" />
19.    </StackPanel>
20.  </Grid>
21.</DataTemplate>


Combo box XAML:

1.<telerik:RadComboBox
2.    IsEditable="True"
3.    StaysOpenOnEdit="True"
4.    ItemsSource="{Binding Path=CitiesCountiesStates}"
5.    SelectedItem="{Binding Path=SelectedCityCountyState}"
6.    OpenDropDownOnFocus="True"
7.    IsFilteringEnabled="True"
8.    ItemTemplate="{StaticResource ComboBoxCustomTemplate}" />


Viewmodel:

01.public class AddEditViewModel : ViewModelBase<IDialogView>, IDisposable
02.{
03.  private readonly GeotechLogContext context;
04. 
05.  public ObservableCollection<CityCountyState> CitiesCountiesStates { get; set; }
06.  private string _SelectedCityCountyState;
07.  public string SelectedCityCountyState
08.  {
09.    get
10.    {
11.      return this._SelectedCityCountyState;
12.    }
13.    set
14.    {
15.      // This doesn't work, but it's what I want to do in concept.
16.      //  Value is always a string that equals the object type
17.      //
18.      //   CityCountyState x = (CityCountyState) value;
19.      //   this._SelectedCityCountyState = x.City + "," + x.County + "," + x.State;
20.      this._SelectedCityCountyState = value;
21.    }
22.  }
23. 
24.  public AddEditViewModel : base( new AddEditWindow() )
25.  {
26.    this.context = new GeotechLogContext();
27.    this.CitiesCountiesStates = new ObservableCollection<CityCountyState>
28.      (this.context.CityCountyStates.ToList<CityCountyState>() );
29.  }
30.}

The problem is obviously at line 27/28, but I don't know how to do it.
Rosen Vladimirov
Telerik team
 answered on 22 Aug 2014
2 answers
138 views
Supposingly I would like to bind ID to each of the aggregate cell and retreive it for later usage using View Model, how could it be done.

I understand that there are row group description, column group description and aggregate description to bind property directly,
but i couldn't find ways to bind id to aggregate cell and ways to retrieve it
Kalin
Telerik team
 answered on 22 Aug 2014
3 answers
136 views
Hello

We have strange behavior on Twinhead Durabook T7M hardware (http://goldrushtechnology.com.au/Products/tabid/57/ProdID/2825/Default.aspx) OS: Microsoft Windows 7 32 bit.

When we try to activate the edit controls (f.e. RadComboBox) via the touch pen, they do not become active. Controls are provided by InlineUIContainer  on the object RadDocument. 

The result is that data can not be replaced via the touch pen. Edit controls have focus only for a fraction of a second, and then focus is lost.

When working with mouse there was no such problem. Installing other drivers for the touch pen did not help.

Problem occurs only for objects placed on the object RadDocument.

Version of Telerik software is 2013 Q2.

Best regards

Daniel Gontarek
Petya
Telerik team
 answered on 22 Aug 2014
1 answer
381 views
I have been using Persistence Framework to save the state of RadGridViews. The RadGridViews have a column chooser which enables the user to change the visible columns (IsVisible=true/false). The WPF program saves the state of grids on exit, and loads them when the program starts. This works very well.

However, recently, as part of an update to the software, I had to remove a column definition from the XAML and the Data Model. I noticed that when the program was loaded again, the column still appears (because I had chosen it in my grid) but the values are all blank.

My question is:
Are there any best practices for using the Persistence Framework with new releases of my software? For example, a way to force an update/automatically remove the persisted data for a particular grid that changes?

Zarko
Telerik team
 answered on 22 Aug 2014
2 answers
171 views
Supposingly I have pivot grid like this

    Text here   | Monday   Tuesday  Wednesday Thursday Friday
Employee 1  |
Employee 2  |
Employee 3  |

I would like to input text in the text here column, how is it possible to do this for pivot grid.
I couldn't find any documentation on it, maybe i just miss out something pretty simple.
Kalin
Telerik team
 answered on 22 Aug 2014
2 answers
240 views
Hello,

Here is my case:
I'm working in MVVM.

In my ViewModel I have a list of object like this one :

public class MyObject
  {
    public string Name { get; set; }

    public Dictionary<string,bool> Options
    {
      get;
      set;
    }
  }

In my View I want to bind my datagrid to a the list of MyObject and have a display looks like :
Name                      | Option1 | Option2  | Option3 | ...
Object1Name          | true       |false        |true
Object2Name          | true       |true         |true
...

The bool should be a checkBox

The string is well displayed but I dont know how display the Dictionary.
I hope someone can help me with this issue.

Thanks,

Eric.

PS : Sorry for the faults but English is not my mother tongue.
Eric
Top achievements
Rank 1
 answered on 22 Aug 2014
3 answers
249 views
How to pass value from datepicker when editing a existing entry in a gridview. For instance I have a column name ExpirationMonth with a cell data of AUG, and I want that to pass in a DatePicker Input, instead of seeing the watermark "Enter date". See the first Image.

The first image when editing a certain entry in a gridview, Aug does not show up in the ExpirationMonth, 2014 does not show up in Expiration Year.

Also when I add an entry still the same even it has a default value, set as
//for ExpirationMonth
DateTime.Now.ToString("MMM");
 
//for Expiration Year
DateTime.Now.ToString("yyyy");

But when I select a month for ExpirationMonth, month I selected appears in the DatePicker input. See the second Image.

What I did to show month and year in the Datepicker Input, here is the code snippet:
public CreditCardWindow()
    {
        InitializeComponent();
 
        CultureInfo cultureInfo = new CultureInfo("en-US");
        DateTimeFormatInfo dateTimeFormatInfo = new DateTimeFormatInfo();
        dateTimeFormatInfo.ShortDatePattern = "MMMM";
        cultureInfo.DateTimeFormat = dateTimeFormatInfo;
        dteExpirationMonth.Culture = cultureInfo;
        string dteMonth = dteExpirationMonth.SelectedValue.ToString();
        dteMonth.ToUpper();
 
        CultureInfo cultureInfo2 = new CultureInfo("en-US");
        DateTimeFormatInfo dateTimeFormatInfo2 = new DateTimeFormatInfo();
        dateTimeFormatInfo2.ShortDatePattern = "yyyy";
        cultureInfo2.DateTimeFormat = dateTimeFormatInfo2;
        dteExpirationYear.Culture = cultureInfo2;
 
 
    }


Regards,
Robert Peter Mansion
Kalin
Telerik team
 answered on 22 Aug 2014
1 answer
156 views
Hello, i still evaluating Telerik gantt. I have made me a sample project in mvvm and i add some gantttasks with sample
data. Now i want to use the ScrollingService.ScrollIntoView to item function but how can i access it from viewmodel?
I also using telerik viewmodelbase for the commands in my viewmodel. Can you please give me a hint?

Regards,
Robert

Kalin
Telerik team
 answered on 22 Aug 2014
1 answer
195 views
Is there any way that I can get the list of pages a document. Or any another way to work out pages from a document ?

Regards
Anand
Petya
Telerik team
 answered on 22 Aug 2014
1 answer
255 views
I am using telerik RadTreeMap control. It is showing error when we use DLL Telerik.Windows.Controls.DataVisualization, version- 2013.3.1316.45 is not supporting. when I use version - 2013.3.1316.40 then it work fine. But all over in our application we already used the DLL of version 2013.3.1316.45 and we cant use the old version DLL 2013.3.1316.40. So how we can use the DLL version 2013.3.1316.45 In RadTreeMap application, please give the solution as early as possible.

Thanks and regards
Shreejit Nechipurat

Martin Ivanov
Telerik team
 answered on 22 Aug 2014
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?