Telerik Forums
UI for WPF Forum
5 answers
392 views

I have a RadGridView and I've used the article located at: http://docs.telerik.com/devtools/wpf/controls/radgridview/style-selectors/rowstyleselector for styling the row Foreground color. Everything works great except the Alternate Rows have the same color as the "regular" (non-alternate) rows.

I use the "BasedOn" attribute of the style to use the loaded theme (expression_dark) and I thought I would create a second style just for the alternate rows. 

Here is the style code:

<Grid.Resources>
    <my:WorkListStyle x:Key="WorkListStyle">
        <my:WorkListStyle.ViewItem>
            <Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewRowStyle}">
                <Setter Property="Foreground" Value="Yellow" />
            </Style>
        </my:WorkListStyle.ViewItem>
    </my:WorkListStyle>
    <my:WorkListAltStyle x:Key="WorkListAltStyle">
        <my:WorkListAltStyle.ViewItem>
            <Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource GridViewAlternateRowStyle}">
                <Setter Property="Foreground" Value="Yellow" />
            </Style>
        </my:WorkListAltStyle.ViewItem>
    </my:WorkListAltStyle>
</Grid.Resources>

Then, in the RadGridView, I set these two options:

RowStyleSelector="{StaticResource WorkListStyle}"
AlternateRowStyleSelector="{StaticResource WorkListAltStyle}"

However, I get a run-time error when the xaml is parse on the "GridViewAlternateRowStyle" in the BasedOn attribute. Is there a different StaticResource I should be using? Thank you.

 

Scott
Top achievements
Rank 1
 answered on 26 Sep 2016
1 answer
247 views

Dear Devexpress,

We are using your Gridview for WPF version 2015.1.225.40.

We have a problem :

for all columns we have a CellTemplate and a CellEditTemplate. The CellTemplate  displays a value(sum) and is always read only.

The CellEditTemplate contains 2 textboxes were 2 separate values can be entered.
When those 2 Textboxes in the CellEditTemplate are read-only, there is still a way to enter a value., Why ?

How is it possible ? By selecting a column by mouse. Just one click on it.( It may not go in CellEditTemplate ). Then press a key (fe 2). Result => the readonly textbox contains now a 2 !

This may not happen.

Is there a solution to fix this problem ?

I have put the exemple code in a attached file. When the CanEdit1 property is set to false the problem occurs.

regards,
Gert

 

 

 

Stefan
Telerik team
 answered on 26 Sep 2016
5 answers
197 views

Hi,

  I want similar editor as RadBrowseEditor in WPF where I can default path to open while opening the file dialog.Is there any similar editor in WPF controls or Is there any alternative??

Regards,

Nagasree.

Dilyan Traykov
Telerik team
 answered on 26 Sep 2016
1 answer
510 views

I'm trying to override or remove the ability to click directly on the content of a DesktopAlert. My problem is that when you set the alert's content to a plain string, it acts as a link-button and upon clicking the text, it will close the window. This is a problem since there are certain DesktopAlerts that I don't want to be closed at all. I can set it as Enabled = False but then the dropdown menu and other parts of the alert quit functioning. This is all created from code behind so it is a little harder for me to set any properties or templates for it in XAML. I thought perhaps I should post in this forum and see if there is a way to not only remove the ability to click the content, but also to remove/override events in code-behind in general for WPF controls created server-side.

Dim mainAlert = New RadDesktopAlert() With {
    .Header = "Messages",
    .Content = "You have " & unreadCount & " new messages",
    .Height = 75,
    .Width = 300,
    .IconTemplate = TryCast(Application.Current.FindResource("radIconTemplate"), DataTemplate),
    .IconColumnWidth = 30,
    .IconMargin = New Thickness(5, 10, 15, 0),
    .CanAutoClose = False,
    .ShowCloseButton = False,
    .Tag = "main",
    .ShowMenuButton = True,
    .MenuItemsSource = GetDesktopAlertMenuItems
}
manager.ShowAlert(mainAlert)

Nasko
Telerik team
 answered on 26 Sep 2016
3 answers
264 views

Hi to all,

I would using ComboBox in specific behavior:

I populate ItemSource with List<MyModel>, OK.

I have to use IsEditable, IsFilteringEnabled, TextSearchMode that allow me to search through items.

When I want to select an item, I click on it. (Selection item not must be automatic)

After that I'll clear selecteditem.

Can I do it?

I tryed with MouseLeftButtonDown  event but it doesn't fire.

Polya
Telerik team
 answered on 26 Sep 2016
5 answers
1.1K+ views
I want the QRCode size to match the Width & Height I specify on the control, but this doesn't work.
The size of the QRCode seems to be limited by Width & Height, but only changes when I set the Version differently.

I have tried to set the content alignment to Stretch also to no effect.

Can you please tell me how to do this?

Thanks,
 Alan
Martin Ivanov
Telerik team
 answered on 26 Sep 2016
6 answers
281 views

I have a RadCartesianChart with a DateTimeContinuousAxis. 

Is it possible to specify a zoom level based on a timespan? 

So that I only see 10 minutes of the chart - even when adding more data. And off course being able to pan through the rest of the chart. 

/Flemming Rosenbrandt

Petar Marchev
Telerik team
 answered on 26 Sep 2016
10 answers
2.1K+ views
Hi guys

I am getting extremely frustrated and actually quite angry because I can't find a way on the Telerik website to download a specific version of the WPF controls. I need version 2012.1.326 but all I can find is realease notes. This is of no use to me. Please will someone help me out?
Steliyan
Telerik team
 answered on 26 Sep 2016
4 answers
284 views

Hi,

  I have the following RadGridView where its ItemsSource which is bound to a collection that its item is inherited from DynamicObject.

  As shown in the screenshot, how can i prevent the column name with "." being truncated in TryGetMember() method?

<telerik:RadGridView Grid.Row="1" Margin="4"
                     GroupRenderMode="Flat"
                     ShowGroupPanel="False"
                     RowIndicatorVisibility="Collapsed"
                     CanUserFreezeColumns="False"
                     ItemsSource="{Binding TestResultRecords, Mode=OneWay}"
                     AutoGenerateColumns="True"
                     IsReadOnly="True"
                     CanUserReorderColumns ="False"
                     CanUserInsertRows="False"
                     CanUserDeleteRows="False"
                     behavior:MyScrollIntoViewAsyncBehavior.IsEnabled="{Binding IsScrollToView, Mode=OneWay}">
            <telerik:RadGridView.SortDescriptors>
                <telerik:SortDescriptor Member="{x:Static res:UIStringTable.DutCnt}"
                                        SortDirection="Ascending" />
            </telerik:RadGridView.SortDescriptors>
</telerik:RadGridView>

TestResultRecords = new ObservableCollection<VolatileDynamicColRecord>();
m_TestRecord = new VolatileDynamicColRecord();
m_TestRecord["Sweep Voltage1-@2.5mA(V)"] = 1234
m_TestRecord["Sweep Voltage1-@2.8mA(V)"] = 5678
m_TestRecord["Sweep Voltage1-Item3(V)"] = 2.74353
TestResultRecords.Add(m_TestRecord);

public class VolatileDynamicColRecord : DynamicObject, INotifyPropertyChanged
{
    private readonly IDictionary<string, object> m_Data;
 
    public VolatileDynamicColRecord()
    {
        m_Data = new Dictionary<string, object>();
    }
 
    public VolatileDynamicColRecord(IDictionary<string, object> source)
    {
        m_Data = source;
    }
     
    public override IEnumerable<string> GetDynamicMemberNames()
    {
        return m_Data.Keys;
    }
 
    public IEnumerable<object> GetDynamicMemberValues()
    {
        return m_Data.Values;
    }
 
    public override bool TryGetMember(GetMemberBinder binder, out object result)
    {
        // Note: when column name contains ".", the text after "." will be truncated.
        result = this[binder.Name];
        return result != null ? true : false;
    }
 
    public override bool TrySetMember(SetMemberBinder binder, object value)
    {
        if (this[binder.Name] == null)
        {
            return false;
        }
        this[binder.Name] = value;
        return true;
    }
 
    public object this[string columnName]
    {
        get
        {
            if (m_Data.ContainsKey(columnName))
            {
                return m_Data[columnName];
            }
            return null;
        }
        set
        {
            if (!m_Data.ContainsKey(columnName))
            {
                m_Data.Add(columnName, value);
                OnPropertyChanged(columnName);
            }
            else
            {
                if (m_Data[columnName] != value)
                {
                    m_Data[columnName] = value;
                    OnPropertyChanged(columnName);
                }
            }
        }
    }
 
    private void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
 
    #region INotifyPropertyChanged Members
 
    public event PropertyChangedEventHandler PropertyChanged;
 
    #endregion

 

Martin
Telerik team
 answered on 23 Sep 2016
6 answers
1.3K+ views
Hi all,

I am trying to get the parameter out of CommandParameter on a button click. I got the parameter values in the EXECUTE method. The issue is the type of my parameter is not what I expected and also I am unable to cast it. 

This is what I have as my parameter value.



Now, I can see the type of my parameter is Telerik.Windows.Controls.Primitives.SelectionChanger<object>​, but I am not able to cast it in codebehind as I cannot see Telerik.Windows.Controls.Primitives.SelectionChanger.  
Not sure if I am able to put my question correctly and completely. Please let me know if you need more information.

Regards,
Deepak
Lance | Senior Manager Technical Support
Telerik team
 answered on 22 Sep 2016
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?