Telerik Forums
UI for WPF Forum
3 answers
143 views
Hello,
I wanted to change the filter labels and localize them,
I used the LocalizationManager and it works fine,
However for three type of data, I'd like to display three type of labels, which are (numerics, DateTime, and strings)
I couldn't manage to localize these different columns with different resource files,
So went through the following solutions  :
Solution I
created a new style/Template for the FilteringControl and applied this style to the control as shown bellow:
<ResourceDictionary>

<local:ImageTypeConverter x:Key="imageTypeConverter"></local:ImageTypeConverter><local:ContainsKeywordsIconConverter x:Key="containsKeywordsIconConverter"></local:ContainsKeywordsIconConverter> <ResourceDictionary.MergedDictionaries>

 

 

 

<ResourceDictionary Source="../Themes/Resources/Dictionaries/FilteringControlStyle.xaml"/>

 

</ResourceDictionary.MergedDictionaries>

 

</ResourceDictionary>

 

 

<telerik:GridViewDataColumn Header="Date" UniqueName="Date"   DataMemberBinding="{Binding DateCreation}" HeaderCellStyle="{StaticResource CustomHeaderCell}">

  

 

                  <telerik:GridViewDataColumn.FilteringControl >
                      <telerik:FilteringControl ></telerik:FilteringControl>
                  </telerik:GridViewDataColumn.FilteringControl>
              </telerik:GridViewDataColumn>
Doing this, the PART_DistinctValuesList is not   filled up with any data, neither the filter expressions is.
Solution II
Created a new control by copy/pasting the previouse style definition of the FilteringControl as shown bellow
 

<Border Margin="0,2,0,0" BorderBrush="#FF848484" BorderThickness="1,1,1,1" CornerRadius="1">

 

<Border Background="#FFE4E4E4" BorderBrush="White" BorderThickness="1">
<StackPanel HorizontalAlignment="Stretch" Margin="5,5,5,5" MaxWidth="350" MinWidth="200" VerticalAlignment="Stretch">

 

<StackPanel x:Name="PART_DistinctFilter" Visibility="Visible">

 

........Up to the end,

Of course, my usercontrol implements  IFilteringControl as stated in the help tutorial
But here I must redefine all actions of the controls, (Onfilter, onclear, selectAll and so on...)

Is there some missing thing I could add in either one of both solutions to overcome the corresponding shortcut ? or  I must continue in the second solution by codding all necessary actions ? which seems to be a bit heavy for just localizing differents columns filters with different resources files,

Thanks in advance for your help,
Abdelkader

 


 

 

 

Maya
Telerik team
 answered on 14 Sep 2010
1 answer
142 views
I have a grid which has a HierarchyChildTemplate .I want the HierarchyChildTemplate in the first row only to be expanded by default. Is there a way to do this?

Thanks,

Billy Jacobs 
Milan
Telerik team
 answered on 14 Sep 2010
1 answer
113 views
Hi,

i have a treeview in my app, and its databoud to data using a HierarchicalDataTemplate
how can i stop certian flagged nodes from been dragged into the root of the treeview?
i need them to be draggable to anyother node, but not the root.

cheers
Kiril Stanoev
Telerik team
 answered on 14 Sep 2010
1 answer
95 views
Hi,

I have a RadDateTimePicker sitting inside a Infragistics docking manager, and the date selection pop up window does not display when you click the date/time selection button.  If I move the RadDateTimePicker outside of the Infragistics docking manager, the control works fine.  Is this a known issue?

TIA.
Kaloyan
Telerik team
 answered on 14 Sep 2010
1 answer
94 views
Hello Telerik,

I wanted to develop a control which should surve the following features,

it should be a selectionlist control,

having features like,

 

  • Must support images/text at the lists
  • Must support multi selection
  • Must generate events where I add new elements at one of the two lists
  • Can sort content of the lists
  • Data will be introduced from an XML file or Database
  • Must support data groups
  • Must have the option of select only "selected elements" or all the items
  • Must return the list of selected items


Did you have any control that provides above features ?

Regards,
Srinivas

 

Rossen Hristov
Telerik team
 answered on 14 Sep 2010
1 answer
146 views
Hi,

We are implementing a custom menu bar for which RadMenu is the underlying control using template approach (controltemplate).

We are able to bind all properties but coming to UI part, our custom control is just showing the menubar with the header items and when we click on
any menuitem, the sub menu's are not showing up.

We couldn't figure what was the actual problem here.

We hope you can give a helping hand in this regard.

Below is the code snippet for generic.xaml......

 

 

 

<Style TargetType="local:TngMenuBar">

 

 

 

 

<Setter Property="Background"

 

 

 

Value="White" />

 

 

 

 

<Setter Property="Foreground"

 

 

 

Value="Black" />

 

 

 

 

<Setter Property="BorderBrush"

 

 

 

Value="Black" />

 

 

 

 

<Setter Property="BorderThickness"

 

 

 

Value="1" />

 

 

 

 

<Setter Property="Template">

 

 

 

 

<Setter.Value>

 

 

 

 

<ControlTemplate TargetType="local:TngMenuBar">

 

 

 

 

<ControlsNavigation:RadMenu Name="PART_TngMenuBar"

 

 

 

DataContext="{TemplateBinding Property=DataContext}"

 

 

 

ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"

 

 

 

ItemTemplate="{TemplateBinding Property=ItemTemplate}"

 

 

 

ItemTemplateSelector="{TemplateBinding Property=ItemTemplateSelector}"

 

 

 

ItemContainerStyle="{TemplateBinding Property=ItemContainerStyle}"

 

 

 

ItemContainerStyleSelector="{TemplateBinding Property=ItemContainerStyleSelector}"

 

 

 

FontSize="{TemplateBinding Property=FontSize}"

 

 

 

FontStyle="{TemplateBinding Property=FontStyle}"

 

 

 

Foreground="{TemplateBinding Property=Foreground}"

 

 

 

ClickToOpen="{TemplateBinding Property=ClickToOpen}"

 

 

 

ShowDelay="{TemplateBinding Property=ShowDelay}"

 

 

 

HideDelay="{TemplateBinding Property=HideDelay}"

 

 

 

Orientation="{TemplateBinding Property=Orientation}"

 

 

 

>

 

 

 

 

 

</ControlsNavigation:RadMenu>

 

 

 

 

 

</ControlTemplate>

 

 

 

 

</Setter.Value>

 

 

 

 

</Setter>

 

 

 

 

 

 

</Style>

 

 

 

 

<Style TargetType="local:TngMenuItem">

 

 

 

 

 

<Setter Property="Template">

 

 

 

 

<Setter.Value>

 

 

 

 

<ControlTemplate TargetType="local:TngMenuItem">

 

 

 

 

<ControlsNavigation:RadMenuItem Name="PART_TngMenuBarItem"

 

 

 

Header="{TemplateBinding Property=Header}"

 

 

 

></ControlsNavigation:RadMenuItem>

 

 

 

 

</ControlTemplate>

 

 

 

 

</Setter.Value>

 

 

 

 

</Setter>

 

 

 

 

</Style>

 


Below is the code snippet for our custom control Menubar.cs code......

 

 

public class TngMenuBar : Control

 

{

#region

 

 

Constructors

 

 

 

public TngMenuBar()

 

{

DefaultStyleKey =

 

typeof(TngMenuBar);

 

Items =

 

new TngMenuBarItemCollection();

 

 

 

 

}

#endregion

 

 

 

public static DependencyProperty ItemsProperty = DependencyProperty.Register(

 

 

 

"Items",

 

 

 

typeof(TngMenuBarItemCollection),

 

 

 

typeof(TngMenuBar),

 

 

 

null);

 

 

 

public TngMenuBarItemCollection Items

 

{

 

 

get { return this.GetValue(ItemsProperty) as TngMenuBarItemCollection; }

 

 

 

set { this.SetValue(ItemsProperty, value); }

 

}

 

 

 

public event RoutedEventHandler ItemClick;

 

 

 

void TngMenu_MouseLeftButtonUp(object sender,

 

 

 

MouseButtonEventArgs e)

 

{

 

 

if (ItemClick != null)

 

ItemClick(

 

this, new RoutedEventArgs());

 

}

 

 

 

 

public override void OnApplyTemplate()

 

{

 

 

base.OnApplyTemplate();

 

 

 

 

RadMenu menu = this.GetTemplateChild("PART_TngMenuBar") as RadMenu;

 

 

 

if (menu == null)

 

 

 

return;

 

 

 

 

for (int i = 0; i < this.Items.Count; i++)

 

{

 

 

TngMenuItem menuItem = this.Items[i];

 

 

menu.Items.Add(menuItem);

}

}

#region

 

 

Property: DataContext

 

 

 

private Object _dataContext;

 

 

 

public Object DataContext

 

{

 

 

get { return GetValue(DataContextProperty); }

 

 

 

set { SetValue(DataContextProperty, value); }

 

}

 

 

public static readonly DependencyProperty DataContextProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"DataContext", typeof(Object), typeof(TngMenuBar),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuBar)o).UpdateDataContext((Object)e.NewValue);

 

}));

 

 

 

private void UpdateDataContext(Object sel)

 

{

_dataContext = sel;

}

#endregion

#region

 

 

Property: ItemsSource

 

 

 

private IEnumerable _itemsSource;

 

 

 

public IEnumerable ItemsSource

 

{

 

 

get { return (IEnumerable)GetValue(ItemsSourceProperty); }

 

 

 

set { SetValue(ItemsSourceProperty, value); }

 

}

 

 

public static readonly DependencyProperty ItemsSourceProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"ItemsSource", typeof(IEnumerable), typeof(TngMenuBar),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuBar)o).UpdateItemsSource((IEnumerable)e.NewValue);

 

}));

 

 

private void UpdateItemsSource(IEnumerable sel)

 

{

_itemsSource = sel;

}

#endregion

#region

 

 

Property: ItemTemplate

 

 

 

private DataTemplate _itemTemplate;

 

 

 

public DataTemplate ItemTemplate

 

{

 

 

get { return (DataTemplate)GetValue(ItemTemplateProperty); }

 

 

 

set { SetValue(ItemTemplateProperty, value); }

 

}

 

 

public static readonly DependencyProperty ItemTemplateProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"ItemTemplate", typeof(DataTemplate), typeof(TngMenuBar),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuBar)o).UpdateItemTemplate((DataTemplate)e.NewValue);

 

}));

 

 

private void UpdateItemTemplate(DataTemplate sel)

 

{

_itemTemplate = sel;

}

#endregion

#region

 

 

Property: ItemTemplateSelector

 

 

 

private DataTemplateSelector _itemTemplateSelector;

 

 

 

public DataTemplateSelector ItemTemplateSelector

 

{

 

 

get { return (DataTemplateSelector)GetValue(ItemTemplateSelectorProperty); }

 

 

 

set { SetValue(ItemTemplateSelectorProperty, value); }

 

}

 

 

public static readonly DependencyProperty ItemTemplateSelectorProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"ItemTemplateSelector", typeof(DataTemplateSelector), typeof(TngMenuBar),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuBar)o).UpdateItemTemplateSelector((DataTemplateSelector)e.NewValue);

 

}));

 

 

private void UpdateItemTemplateSelector(DataTemplateSelector sel)

 

{

_itemTemplateSelector = sel;

}

#endregion

#region

 

 

Property: ItemContainerStyle

 

 

 

private Style _itemContainerStyle;

 

 

 

public Style ItemContainerStyle

 

{

 

 

get { return (Style)GetValue(ItemContainerStyleProperty); }

 

 

 

set { SetValue(ItemContainerStyleProperty, value); }

 

}

 

 

public static readonly DependencyProperty ItemContainerStyleProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"ItemContainerStyle", typeof(Style), typeof(TngMenuBar),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuBar)o).UpdateItemContainerStyle((Style)e.NewValue);

 

}));

 

 

private void UpdateItemContainerStyle(Style sel)

 

{

_itemContainerStyle = sel;

}

#endregion


Below is the code snippet for our custom control MenuItem.cs code......

 

 

 

public class TngMenuItem:ContentControl

 

 

 

 

 

 

{

 

 

 

 

 

#region

 

 

Constructors

 

 

 

public TngMenuItem()

 

{

DefaultStyleKey =

 

typeof(TngMenuItem);

 

Items =

 

new TngMenuBarItemCollection();

 

}

 

 

 

 

#endregion

 

 

 

 

 

 

 

public static DependencyProperty ItemsProperty = DependencyProperty.Register(

 

 

 

"Items",

 

 

 

typeof(TngMenuBarItemCollection),

 

 

 

typeof(TngMenuItem),

 

 

 

null);

 

 

 

public TngMenuBarItemCollection Items

 

{

 

 

get { return this.GetValue(ItemsProperty) as TngMenuBarItemCollection; }

 

 

 

set { this.SetValue(ItemsProperty, value); }

 

}

 

 

public override void OnApplyTemplate()

 

{

 

 

base.OnApplyTemplate();

 

 

 

 

RadMenuItem menuitem = this.GetTemplateChild("PART_TngMenuBarItem") as RadMenuItem;

 

 

 

if (menuitem == null)

 

 

 

return;

 

 

 

for (int i = 0; i < this.Items.Count; i++)

 

{

 

 

TngMenuItem cmi = this.Items[i];

 

 

menuitem.Items.Add(cmi);

}

}

 

 

 

 

 

 

#region

 

 

Property: Header

 

 

 

private Object _header;

 

 

 

public virtual Object Header

 

{

 

 

get { return GetValue(HeaderProperty); }

 

 

 

set { SetValue(HeaderProperty, value); }

 

}

 

 

public static readonly DependencyProperty HeaderProperty =

 

 

 

DependencyProperty.Register(

 

 

 

"Header", typeof(Object), typeof(TngMenuItem),

 

 

 

new PropertyMetadata((o, e) =>

 

{

((

 

TngMenuItem)o).UpdateHeader((Object)e.NewValue);

 

}));

 

 

private void UpdateHeader(Object sel)

 

{

_header = sel;

}

 

 

 

 

#endregion

Below is the code snippet for our custom control MenuItemcollection.cs code......

 

 

 

public class TngMenuBarItemCollection : ObservableCollection<TngMenuItem>

 

{

}

 

 



 

Pana
Telerik team
 answered on 14 Sep 2010
5 answers
2.2K+ views
Hi. I'm developing a form on which the user can select one of many reports to show, and I have two questions on the GridView:

  1. Do you always have to specify a Columns collection? I mean, because I can have many different reports for the same GridView, I want to be able to show them all without having to specify the columns individually.
  2. How do you programatically hide or show a column at a specific index or with a specific header? My user wants to be able to hide some columns before exporting the report results, so I'm planning on showing him a CheckBox list with the columns, so he can choose which ones to show/hide.

Thanks a lot.
Vlad
Telerik team
 answered on 13 Sep 2010
6 answers
233 views

 

 

 

I have following column amongst other columns:

...

<
grid:GridViewDataColumn IsReadOnly="False" IsSortable="False" Header="Comment"

 

 

 

                         DataMemberBinding="{Binding Comment}" MaxWidth="250" IsResizable="False" >

 

 

 

 

    <grid:GridViewDataColumn.CellEditTemplate>

 

 

 

 

        <DataTemplate>

 

 

 

 

            <TextBox Text="{Binding Comment}" MaxLength="50" />

 

 

 

 

        </DataTemplate>

 

 

 

 

    </grid:GridViewDataColumn.CellEditTemplate>

 

 

 

 

</grid:GridViewDataColumn>

...

Issue:

When there is more than one row in the grid, editing of this cell can be ended in whatever way (by focusing on some other field, pressing enter... etc.) and the grid will retain the value entered. Such value will also be updated into the database by:

 

private

 

 

void radGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
{...}


However, when there is only one row in the grid, pressing enter to end the cell edit works for retaining the value just entered for the cell but not triggering "CellEditEnded". Therefore, the value entered is not being put into the database...

Is there anyway someone help me with this?

Thanks for your time in advance,

K

 

 

 

Maya
Telerik team
 answered on 13 Sep 2010
1 answer
72 views
i need to create quadrant-style gauge and semicircle gauge dynamically using vb.net or c#.net code please help me out..!!

Regards,
Kapil Garg
Andrey
Telerik team
 answered on 13 Sep 2010
6 answers
383 views
Hello :)

I have a problem when I try to add a new row to the gridview,  

In short, I have an empty gridview and the event RowEditEnded fires before the new row appears for editing and without the user presses enter when adding a new row into the gridview when the grid view is not empty (when the gridview is empty RowEditEnded event fires after the user presses enter).

My scenario is the following:

When the gridview is empty, I use the BeginInsert() method to insert a new row, then the handler for the AddingNewDataItem gets executed, then appears a new row on the gridview with the first cell on edit mode, then I fill all the cells on the gridview and after that I hit enter, after I press enter the handler for the RowEditEnded event gets executed with e.EditOperationType==Insert  and e.EditAction==Commit, (in this handler I add the new row to a data base) and so far so well, but when I want to insert an other new row, the handler for the AddingNewDataItem event gets executed and just after that (and here is the problem) the handler for the RowEditEnded event gets executed with e.EditOperationType==Insert and e.EditAction==Commit (without the new row appears for editing and without the user presses enter) and after that the row appears on the grid view ready for editing (also for default appears the last cell of the row in edit mode and for this reason I have to press esc and go to the first cell of the row), so the RowEditEnded event fires before the new row appears for editing and without the user presses enter.

Is this the default behavior or am I doing something wrong? 

void NuevoProveedorButton_Click(object sender, RoutedEventArgs e)
{
            this.ProveedoresGridView.BeginInsert();
}
 
void ProveedoresGridView_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
{
            e.NewObject = new Proveedor_TipoProveedor();
}




Maya
Telerik team
 answered on 13 Sep 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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
SplashScreen
Rating
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?