Telerik Forums
UI for WPF Forum
3 answers
131 views

Hi,

   We are trying to get the columnHeaderProperty using TableItemPattern on the Automationelement of cell inside RadGridView but it is giving wrong header value. It is giving the next header value. Here RawGridView have columns and rows virtualization support enabled.

Regards,

Nagasree.

 

Stefan
Telerik team
 answered on 07 Dec 2016
3 answers
230 views

How can I insert text in a group footer's cell?

 

01.public MainWindow()
02.{
03.    InitializeComponent();
04. 
05.    var style = new Style();
06.    style.Setters.Add(new Setter(GroupHeaderRow.ShowGroupHeaderColumnAggregatesProperty, false));
07.    style.Setters.Add(new Setter(GroupHeaderRow.ShowHeaderAggregatesProperty, false));
08.    var radGrid = new RadGridView { GroupRenderMode = GroupRenderMode.Flat, GroupRowStyle = style};
09.    Content = radGrid;
10. 
11.    // Table schema
12.    var data = new DataTable();
13.    var user = data.Columns.Add("User");
14.    var cat = data.Columns.Add("Category");
15.    var amt = data.Columns.Add("Amount", typeof(decimal));
16. 
17.    // Populate values
18.    var catValues = new[] {"Cat A", "Cat B", "Cat C"};
19.    for (var i = 0; i < 20; i++)
20.    { data.Rows.Add("User " + i, catValues[i % catValues.Length], i * 100d); }
21.             
22.    // Prepare RadGridView
23.    radGrid.ItemsSource = data;
24.    radGrid.AutoExpandGroups = true;
25.    radGrid.ShowColumnFooters = true;
26.    radGrid.AutoGenerateColumns = false;
27. 
28.    // Build RadGrid columns
29.    var gridColumns = new[] {user, cat, amt}
30.        .Select(dataColumn => new GridViewDataColumn
31.        {
32.            UniqueName = dataColumn.ColumnName,
33.            DataMemberBinding = new Binding(dataColumn.ColumnName),
34.        })
35.        .ToList();
36.    radGrid.Columns.AddRange(gridColumns);
37. 
38.    // Sum Amount
39.    var amtCol = gridColumns.Last();
40.    var amtFormat = "{0:C}";
41.    amtCol.DataFormatString = amtFormat;
42.    amtCol.AggregateFunctions.Add(new SumFunction()
43.    {
44.        SourceField = amt.ColumnName,
45.        SourceFieldType = amt.DataType,
46.        ResultFormatString = amtFormat
47.    });
48.    radGrid.ShowGroupFooters = true;
49. 
50.    // Group by category
51.    var catGroup = new GroupDescriptor { Member = cat.ColumnName, };
52.    radGrid.GroupDescriptors.Add(catGroup);
53. 
54.    // Show grand total label
55.    radGrid.Columns[0].Footer = "Grand Total";
56. 
57.    // todo: How to show group subtotal label?
58. 
59.}
MC
Top achievements
Rank 1
 answered on 07 Dec 2016
2 answers
367 views

Hello,

I recently installed UI for WPF R3 2016 and today I was updated our project references to use the new version when I noticed a problem.

Several of the .dlls in the WPF45 directory, which should be for assemblies built for .Net 4.5, are actually the version for .Net 4.0.

If you look at the attached image, it's just a screenshot of Windows explorer open to C:\Program Files (x86)\Telerik\UI for WPF R3 2016\Binaries\WPF45.  I am showing the file version in the list and there are 10 .dlls that show version number 2016.3.1021.40, when it should be 2016.3.1024.45.

I think an updated installer needs to be posted for this release.

Thanks,

Peter

Peter
Top achievements
Rank 1
 answered on 06 Dec 2016
3 answers
261 views

Hi,

 

I found it is hard to drag scroll bar from side to side even column virtualization is enable.

Could you give us some advice how to fix this issue?

My Grid has more than 30 columns and about 300 rows.

 

please reply it.

Yoan
Telerik team
 answered on 06 Dec 2016
1 answer
320 views

I use the gridview's row validating event to perform some validations. 

All database methods in my persistence framework are defined async. The validation method needs database access, so it's also defined as async and returns a Task<bool>. 

The row validating event handler awaits this validation method. If the validation fails, the isValid property is set to false.

Everything works fine as long as there is no asynchronous database call and the code execution runs synchronously. As soon as I have real asynchronism, the grid view doesn't wait for the completion of the validating event handler anymore. It continues its internal validation and the RowEditEnded event raises - although the RowValidating event handler hasn't finished already. 

How can I force the grid view to wait for the asynchronous validation? I know that there are some issues with events and the async/await pattern and I tried different declaration types - without success.

Thanks for you help!

Ivan Ivanov
Telerik team
 answered on 06 Dec 2016
1 answer
192 views

Ok, so I have gridview with IsReadOnly = True. I allow the user to expand the rowdetails and edit data using a raddataform. This the bound object for this form has dataannotations which are used to validate the record. Suppose I have a required field that is left blank. The form recognizes the problem and disables the save button, but I'm still allowed to navigate to another row. How to prevent this (mvvm style ... of course!)?

Thanks ... Ed

 

Stefan Nenchev
Telerik team
 answered on 06 Dec 2016
3 answers
240 views

I have been looking through the Telerik RadMenu WPF demos and found the Customization_MVVM_WPF demo.I have a couple of questions with regard to this demo that I hope someone can help me with.

Question:
The MVVM demo has a class "MenuItemContainerTemplateSelector" that does not appear to be used by the demo. I can see that the 'MenuItemStyleSelector' class is used, but am curious when to use the MenuItemContainerTemplateSelector as opposed to the MenuItemStyleSelector? Is there a demo where this MenuItemCoontainerTemplateSelector class is used which I can take a look at the implementation?

 

What I am trying to accomplish:

I need to create a RadMenu which dynamically binds to a collection of ViewModels (RadMenuItems) and uses DataTemplates or styles to tell 'how' to display each of the ViewModels. Are there examples demonstrating this which I have not yet found? The Customization_MVVM_WPF demo somewhat covers this, but attempting to move the MenuItemsSource in this demo out of the XAML and into a collection of ViewModels which the RadMenu binds to seems to not work.

Stefan
Telerik team
 answered on 06 Dec 2016
2 answers
369 views

Hello,

I am using this example to get a row number in my gridview:
http://www.telerik.com/forums/how-to-display-the-row-number

I altered the code from the example and added a dependency property to it, which I am binding to a property of an item from the itemssource collection of the gridview.

public class RowNumberPresenter : TextBlock
{
    private GridViewDataControl _parentControl;
    public GridViewDataControl ParentControl
    {
        get { return this._parentControl; }
        private set
        {
            if (this._parentControl != null)
                this._parentControl.Items.CollectionChanged -= new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
            this._parentControl = value;
            if (this._parentControl != null)
                this._parentControl.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
        }
    }
  
    public RowNumberPresenter(GridViewDataControl parentControl, object dataItem)
        : base()
    {
        ParentControl = parentControl;
        SetText(dataItem);
    }
  
    private void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    {
        SetText(this.DataContext);
    }
  
    private void SetText(object dataItem)
    {
        if (this.ParentControl.IsGrouping)
        {
            var group = this.ParentControl.FindGroupByItem(dataItem);
            if (group != null)
            {
                var items = group.Items as ReadOnlyObservableCollection<object>;
                if (items != null)
                    this.Text = (items.IndexOf(dataItem) + 1).ToString();
            }
        }
        if (string.IsNullOrWhiteSpace(this.Text))
            this.Text = (this.ParentControl.Items.IndexOf(dataItem) + 1).ToString();
    }
}

 

public class RowNumberGridViewColum : GridViewColumn
{       
    private RowNumberPresenter _rowNumberPresenter;
 
 
    public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
    {
        _rowNumberPresenter = cell.Content as RowNumberPresenter;
        if (_rowNumberPresenter == null)
            _rowNumberPresenter = new RowNumberPresenter(this.DataControl, dataItem);
             
        CurrentIndex = Int32.Parse(_rowNumberPresenter.Text);
        return _rowNumberPresenter;
    }
 
    public int CurrentIndex
    {
        get { return (int)GetValue(CurrentIndexProperty); }
        set { SetValue(CurrentIndexProperty, value); }
    }
 
    public static readonly DependencyProperty CurrentIndexProperty =
        DependencyProperty.Register("CurrentIndex", typeof(int), typeof(RowNumberGridViewColum));
}

 

<cControlsTelerik:RowNumberGridViewColum 
                IsReadOnly="True"
                TabStopMode="Skip"
                TextAlignment="Center"
                CurrentIndex="{Binding Path=OrderRowData.SequenceNumber}">
    <cControlsTelerik:RowNumberGridViewColum.Header>
        <TextBlock Text="No.:"/>
    </cControlsTelerik:RowNumberGridViewColum.Header>
</cControlsTelerik:RowNumberGridViewColum>


The binding is not working and I am I am a little stuck how to bind the rownumber of the row to my dataobject (a OrderRow object).
I receive the error that OrderRowData is not a property of OrderViewModel, OrderViewModel is my VM for the whole view?

The Itemssource of the gridview is set to a Rows property on my OrderViewModel, this Rows collection contains all the OrderRowData instances visible in the grid.

Any help would be appreciated.

Regards,

Marcel

 

Marcel
Top achievements
Rank 1
 answered on 06 Dec 2016
5 answers
328 views
 Lets say, i have 70 records, and currently in view is 18 records. Now, I am pressing tab for 19th time then scroll down to display 19th record. Scroll according to tab key navigation.
Please see attachment
Yoan
Telerik team
 answered on 06 Dec 2016
2 answers
265 views
Hello folks!


How can I add DockingPanesFactory to the RadDocking dynamically?

 <telerik:RadDocking 
                            x:Name="Docking"
                            >
            <telerik:RadDocking.DockingPanesFactory>
                <local:CustomDockingPanesFactory />
            </telerik:RadDocking.DockingPanesFactory>
   </telerik:RadDocking>

 var Dock = new Telerik.Windows.Controls.RadDocking();
.....
Any advise or suggestion will be greatly appreciated.

hokushin
Top achievements
Rank 1
 answered on 06 Dec 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
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?