Telerik Forums
UI for WPF Forum
2 answers
406 views
Hi There,

I have created a style which will display a textblock in place of content control and i have to display a tooltip when user mouseover on selected item. unfortunately i am unable to see the tool tip even thought i set it. please see the below template for RadCombobox.
Please let me know how i can do this.

<ControlTemplate x:Key="NonEditableComboBox" TargetType="telerikInput:RadComboBox">
      <Grid x:Name="VisualRoot">
          <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                  <VisualState x:Name="Disabled">
                      <Storyboard>
                          <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_DropDownButton" Storyboard.TargetProperty="Opacity">
                              <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value=".5" />
                          </DoubleAnimationUsingKeyFrames>
                      </Storyboard>
                  </VisualState>
                  <VisualState x:Name="Normal">
                  </VisualState>
                  <VisualState x:Name="MouseOver">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Background">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HoverBackground}" />
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_MouseOver}" />
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_MouseOver}" />
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </VisualState>
                  <VisualState x:Name="DropDownOpen">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundBorder" Storyboard.TargetProperty="Background">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DropDownOpenBackground}" />
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Pressed}" />
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
                              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Pressed}" />
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusBorder" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                  <DiscreteObjectKeyFrame.Value>
                                      <Visibility>Collapsed</Visibility>
                                  </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PopupFakeBorder"
                                  Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                  <DiscreteObjectKeyFrame.Value>
                                      <Visibility>Visible</Visibility>
                                  </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                  <VisualState x:Name="Focused">
                      <Storyboard>
                          <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusBorder" Storyboard.TargetProperty="Visibility">
                              <DiscreteObjectKeyFrame KeyTime="0">
                                  <DiscreteObjectKeyFrame.Value>
                                      <Visibility>Visible</Visibility>
                                  </DiscreteObjectKeyFrame.Value>
                              </DiscreteObjectKeyFrame>
                          </ObjectAnimationUsingKeyFrames>
                      </Storyboard>
                  </VisualState>
                  <VisualState x:Name="Unfocused" />
              </VisualStateGroup>
          </VisualStateManager.VisualStateGroups>
          <Border x:Name="PopupFakeBorder" Visibility="Collapsed" BorderThickness="1,0,1,0" CornerRadius="5,5,0,0"
                  Grid.ColumnSpan="2" Background="{StaticResource PickerPopupBackground_fake}"
                  BorderBrush="{TemplateBinding BorderBrush}" />
          <Border IsHitTestVisible="False" Background="{TemplateBinding Background}" CornerRadius="5" />
          <telerik:RadToggleButton x:Name="PART_DropDownButton" Foreground="{TemplateBinding Foreground}" IsTabStop="False" Margin="0" Padding="0" ClickMode="Press">
              <telerik:RadToggleButton.Template>
                  <ControlTemplate TargetType="telerik:RadToggleButton">
                      <ContentPresenter />
                  </ControlTemplate>
              </telerik:RadToggleButton.Template>
              <Grid>
                  <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="36" />
                  </Grid.ColumnDefinitions>
                  <Border x:Name="BackgroundBorder"
                          CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
                          Grid.ColumnSpan="2"
                          BorderBrush="{StaticResource Control_OuterBorderBrush}" BorderThickness="1" Background="{StaticResource DefaultBackground}" />
                  <ContentControl x:Name="DropDownIcon"
                                  Grid.Column="1"
                                  IsTabStop="False"
                                  Foreground="{StaticResource ButtonIconForeground_Normal}"
                                  Background="{StaticResource ButtonIconBackground_Normal}"
                                  Template="{StaticResource ArrowTemplateNonEditableCombobox}" />
                  <TextBlock x:Name="Content"
                             FontFamily="Segoe UI"
                             IsHitTestVisible="False"
                             Grid.Column="0"
                             Foreground="{TemplateBinding Foreground}"
                             HorizontalAlignment="Left"
                             Margin="{TemplateBinding Padding}"
                             VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                             Text="{TemplateBinding SelectionBoxItem}"
                             TextTrimming="CharacterEllipsis"
                            ToolTip="{TemplateBinding  SelectionBoxItem}">
              
                  </TextBlock>
                  <!--<ContentPresenter x:Name="Content"
                                    Grid.Column="0"
                                    Margin="{TemplateBinding Padding}"
                                    IsHitTestVisible="False"
                                    Content="{TemplateBinding SelectionBoxItem}"
                                    ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                    TextBlock.Foreground="Black"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />-->
                  <Border x:Name="FocusBorder"
                          BorderThickness="1"
                          Margin="1"
                          Visibility="Collapsed"
                          BorderBrush="{StaticResource Control_FocusBorderBrush}" Grid.ColumnSpan="2" CornerRadius="3" />
              </Grid>
          </telerik:RadToggleButton>
          <Popup x:Name="PART_Popup">
              <Grid x:Name="PopupRoot">
                  <Border BorderThickness="{TemplateBinding BorderThickness}" Margin="0,-10,0,0" Padding="0,10,0,0" BorderBrush="{TemplateBinding BorderBrush}" MinWidth="{TemplateBinding MinDropDownWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Background="{StaticResource PickerPopupBackground}" CornerRadius="0 0 5 5">
                      <Grid>
                          <Grid.RowDefinitions>
                              <RowDefinition Height="Auto" />
                              <RowDefinition Height="*" />
                          </Grid.RowDefinitions>
                          <telerik:RadButton x:Name="PART_ClearButton" Grid.Row="0" Margin="-1 -1 -1 0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}" Content="{TemplateBinding ClearSelectionButtonContent}" />
                          <ScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" Foreground="{TemplateBinding Foreground}" Padding="0 1 0 0" BorderThickness="0" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
                              <ItemsPresenter />
                          </ScrollViewer>
                      </Grid>
                  </Border>
              </Grid>
          </Popup>
      </Grid>
  </ControlTemplate>

Regards,
Srinivas.
Ravi
Top achievements
Rank 1
 answered on 06 Jun 2013
0 answers
125 views
I'm populating a GridView with a large (>10k) number of items and using VirtualQueryableCollectionView with a load size of about 500. I've also enabled deferred scrolling so that the user can quickly scroll to any part of the list without the UI feeling sluggish.

From what I can gather the virtualized elements that get loaded start at the first element visible on the screen and go from there. That's fine if the user is scrolling down because the load only happens once every 500 records, but if the user scroll *up* then a complete 500-record load occurs once for every line scroll. What I need/want is for 250 records to be loaded on either side of the first visible element, that way the user  can thumb scroll to anywhere in the list and then mouse scroll in either direction without hitting the database constantly as they're scrolling.

What's the best way to achieve this? Is it possible to force the loading of a given range of items in response to the ItemsLoading event?

Mark
Top achievements
Rank 1
 asked on 05 Jun 2013
4 answers
418 views
Is there a way to programmatically unselect an item. Right now, upon selection, we launch a window to do some processing on the item and when we are done, we want to return the rad time line to its prior state. We want to unselect the item, so if the item is selected again, it will launch the edit window.

Please let me know.
Paul
Pavel
Top achievements
Rank 1
 answered on 05 Jun 2013
1 answer
117 views
I'm missing something here. There's tons and tons of documentation for the RadGridView and yet I still can't find some simple documentation on what I'm looking for. I don't have a lot of .Net experience, so maybe that's the problem, not the Gridview.

I've got a bound gridview (in a WPF application) that gets populated from a dataset. When the user is finished and clicks the update button, I want my code to go through the grid, apply local business rules and formating to individual cell entries, delete records as necessary, and then send the grid contents back to the database.

I would like to go, row by row, through my grid, get the contents of a given column, modify it if necessary, and then call my Stored Procedure to take the data from the row and write it back to the database.

Do I have to set my gridview up as unbound to accomplish this?
Yoan
Telerik team
 answered on 05 Jun 2013
6 answers
488 views
I'm currently working on a project that has different windows opened up in multiple threads. There seems to be a problem with commands running in all but the first thread that is created with a RadDocking element in it.

Within each thread, a new window is created, with a RadDocing, RadSplitContainer, RadPaneGroup and a single RadPane. The window is then displayed. When you click on the PaneHeader in any window other than the first thread that is opened, the application immediately throws a threading exception: System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.

This exception occurs even when we have no code other than starting the threads. Has anyone else had this problem? Is there any way to fix this problem?

Thanks,
Daniel
George
Telerik team
 answered on 05 Jun 2013
2 answers
165 views
Hi.
I'm not sure if im doing something wrong, but assuming this example:
http://demos.telerik.com/silverlight/#GridView/Performance
with 1000000 rows, 5 columns.
I need to load 2500 records with 8 to 10 columns and doing it like:

1st attempt to load data: using class product:

 using (SqlConnection conn = new SqlConnection(cString.c_String))
            {
                conn.Open();
SqlCommand cmd = new SqlCommand(sqlCommand, conn);
                rdr = cmd.ExecuteReader();
                while (rdr.Read())
{
-- Product p =new Product {.....};
myGrid.Add(p);
}

Second attempt:
                 SqlDataAdapter sd = new SqlDataAdapter(new SqlCommand(sqlCommand, conn));
                 DataTable dt = new DataTable();
                 sd.Fill(dt);
                dg.ItemsSource = dt.DefaultView;


Second is little bit faster i guess, but still tooks much time to load.
I have also tested only window loading time and it took ~1sec to load (only window, with listview with items from db)
Unfortunately with gridView it tooks 5 to 10 sec.

Question is:
Is there any way to (for example) load only first 50 records, and when i scroll down load more?
Or maybe there's example for gridView (WPF!) paging ?


Thanks for answer,
Adam.
Rossen Hristov
Telerik team
 answered on 05 Jun 2013
2 answers
69 views
Hello,
I have simple  question.
How to change the the tool tip  for all buttons in the DataForm?
Thanks
hiwa
Hiwa
Top achievements
Rank 2
 answered on 05 Jun 2013
0 answers
113 views
I have an wpf page with radgridview control and some radmaskednumericinput controls.the question is  whille Selection changed event of radgridview of every row i need to enter new data radmaskednumericinput control on every row and the data should not change till closing the page .
Ramki
Top achievements
Rank 1
 asked on 05 Jun 2013
1 answer
101 views

I found this article without answer. I have the same problem can anybody help me?

I am using Telerik's WPF controls. In particular the DataForm control. I am trying to bind it to an object that has the following make up.

public class FrequencyMap : BindableBase
{
    private Guid id;

    public Guid ID
    {
        get { return id; }
        set
        {
            id = value;
            OnPropertyChanged();
        }
    }

    private string procedureCodeId;

    public string ProcedureCodeId
    {
        get { return procedureCodeId; }
        set
        {
            procedureCodeId = value;
            OnPropertyChanged();
        }
    }

    private FrequencyChoice frequency;

    public FrequencyChoice Frequency
    {
        get { return frequency; }
        set
        {
            frequency = value;
            OnPropertyChanged();
        }
    }

    private DateTime effectiveDate;

    public DateTime EffectiveDate
    {
        get { return effectiveDate; }
        set
        {
            effectiveDate = value;
            OnPropertyChanged();
        }
    }

    private DateTime? terminateDate;

    public DateTime? TerminateDate
    {
        get { return terminateDate; }
        set
        {
            terminateDate = value;
            OnPropertyChanged();
        }
    }
}

and then the FrequencyChoice object looks like this:

    public class FrequencyChoice : BindableBase
{
    private int id;

    private string modifiedUser;

    public int ID
    {
        get { return id; }
        set
        {
            id = value; OnPropertyChanged();
        }
    }

    private string code;

    public string Code
    {
        get { return code; }
        set
        {
            code = value; OnPropertyChanged();
        }
    }

    private string name;

    public string Name
    {
        get { return name; }
        set
        {
            name = value; OnPropertyChanged();
        }
    }

    private string description;

    public string Description
    {
        get { return description; }
        set
        {
            description = value; OnPropertyChanged();
        }
    }

    private string calculationDescription;

    public string CalculationDescription
    {
        get { return calculationDescription; }
        set
        {
            calculationDescription = value; OnPropertyChanged();
        }
    }

    private DateTime inactiveDate;

    public DateTime InactiveDate
    {
        get { return inactiveDate; }
        set
        {
            inactiveDate = value; OnPropertyChanged();
        }
    }

    public string ModifiedUser
    {
        get
        {
            return this.modifiedUser;
        }
        set
        {
            this.modifiedUser = value;
            OnPropertyChanged();
        }
    }

}

This works quite well except for the Frequency property. How do I get that to work properly(I need name property to be in drop down list box for choose). Do I have to use an Enum like this article? Data Forms in your XAML If so how would I link the two?

Thank you for your help.
Ondrej

Maya
Telerik team
 answered on 05 Jun 2013
1 answer
59 views
I am raising this concern as the Context Menu present in WPF does not work for web browser control.
Does the RadContextMenu help us in achieving custum context menu in WPF web browser control?
Rosen Vladimirov
Telerik team
 answered on 05 Jun 2013
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?