Telerik Forums
UI for WPF Forum
2 answers
85 views
Hi,

  <>How we can apply Binding.ValidationRules in the telerik:RadNumericUpDown control  ?
Rahul
Top achievements
Rank 1
 answered on 13 Apr 2011
1 answer
85 views
Hi,

I have found a serious bug in the new release. I have attached the example project as well. 

Run the project using the set of DLLs which are there in the bin/debug folder. 

There are Three columns in the GridView. Second column is set to invisible (isVisible = false). But when you run the project you can see second column is visible. Although the Header is empty. you can't resize the column. it just sit there.

One thing I figured it out that if I don;t set the width property of other columns it looks fine. But as you play with the Width or MinWidth property of column it will display the hidden column.

It was not happening before. These Telerik dll we got from the RadControls_for_WPF35_2011_1_0315_Dev.msi Setup.

The same issue is happening in silverlight as well. Let me know if you have any trouble in reproducing it.

I don't find any way to attach the sample project. so just pasting the code here. Name the project as "HiddenColumns". There are two files MainWindow.xaml and MainWindow.xaml.cs

Regards
Sanket Singhvi

MainWindow.xaml
----------------------
<Window x:Class="HiddenColumns.MainWindow"
        xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Controls:RadGridView x:Name="_mainGrid" SelectionUnit="FullRow" SelectionMode="Single">
        </Controls:RadGridView>
    </Grid>
</Window>
 
MainWindow.xaml.cs
-------------------------
 
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
 
namespace HiddenColumns
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private DataTable _dataTable;
        private GridViewDataColumn _colA;
        private GridViewDataColumn _colB;
        private GridViewDataColumn _colC;
 
        public MainWindow()
        {
            InitializeComponent();
            Init();
        }
 
        private void Init()
        {
            CreateGrid();
            GetDataTable();
            FillGrid();
        }
 
        private void FillGrid()
        {
            DataRow row = _dataTable.NewRow();
            row["_colA"] = "1";
            row["_colB"] = "This is a Dummy Record";
            row["_colC"] = "This is Third Column";
            _dataTable.Rows.Add(row);
 
            _mainGrid.ItemsSource = _dataTable;
        }
 
        private void CreateGrid()
        {
            _mainGrid.AutoGenerateColumns = false;
            if (_colA == null)
            {
                _colA = new GridViewDataColumn();
            }
 
            //
            //  _ColA
            //
            _colA.UniqueName = "_colA";
            _colA.Header = "Column A";
            _colA.IsGroupable = false;
            _colA.IsFilterable = false;
            _colA.IsReadOnly = true;
            _colA.IsVisible = true;
            _colA.Width = 100;
 
            if (_colB == null)
            {
                _colB = new GridViewDataColumn();
            }
 
            //
            //  _colB
            //
            _colB.UniqueName = "_colB";
            _colB.Header = "Column B";
            _colB.IsGroupable = false;
            _colB.IsFilterable = false;
            _colB.IsReadOnly = true;
            _colB.IsVisible = false;
             
            //
            //  _colC
            //
            if (_colC == null)
            {
                _colC = new GridViewDataColumn();
            }
            _colC.UniqueName = "_colC";
            _colC.Header = "Column C";
            _colC.IsGroupable = false;
            _colC.IsFilterable = false;
            _colC.IsResizable = false;
            _colC.Width = 150;
 
            _mainGrid.Columns.Clear();
            _mainGrid.Columns.Add(_colA);
            _mainGrid.Columns.Add(_colB);
            _mainGrid.Columns.Add(_colC);
 
            //_mainGrid.Width = 480;
            _mainGrid.ShowGroupPanel = false;
        }
 
        private void GetDataTable()
        {
            if (_dataTable == null)
            {
                _dataTable = new DataTable();
            }
            _dataTable.Columns.Add("_colA");
            _dataTable.Columns.Add("_colB");
            _dataTable.Columns.Add("_colC");
        }
    }
}

Vlad
Telerik team
 answered on 13 Apr 2011
1 answer
99 views
I'm trying to implement custom filtering. I need to be the one who applies the new filter options to the underlying IEnumerable/IQueryable, as I have to apply certain column filters specially for the data source.

I can't figure out how I can be made responsible for returning the IQueryable that the RadGridView ultimately uses. i'd sort of expect an event like Filtering to have a return object on the EventArgs, for me to pass the IEnumerable back to it.

I'm also completely at a loss as to how to integrate this into the DataPager. Once again, I need to be responsible for implementing the page count retrieval.

Update: I think I can do it by implementing a custom QueryProvider and IQueryable, and parsing what Telerik applies to it into my own form. This sounds hard, though. =/

It's complicated by the fact that my data model doesn't actually have real members for the things I want to query by. I sort of would rather pass them around as text keys.

For example. I'm showing a list of Person objects. Person objects have a collection of Name objects. Only one of which is the "active name." I want the First Name column's filter to be handled by formulating some custom SQL that joins to Name, eliminates all by the current one, and filters that one's FirstName property. I can easily write this code, but I can't figure out how to grab the FilterDescriptor of the FirstName column and actually apply it to the result set the RadGridView AND pager use.
Vlad
Telerik team
 answered on 13 Apr 2011
2 answers
427 views
I need to refresh schedule view on button click or any event. when i bind data with it first time it works perfectly second time when i changed the data and rebind it, its not refresh the scheduleview
Faheem
Top achievements
Rank 1
 answered on 12 Apr 2011
0 answers
63 views
Hi,

I am using a stack panel with a TextBlock & ItemsControl.

How do I export the data to Excel.

Any quick sample will be highly appreciated.

Thanks & Regards,
Hirak

hirak
Top achievements
Rank 1
 asked on 12 Apr 2011
0 answers
71 views

Hi,

we are using GridView.ToHtml method for Export grid's records.

Depending on records count, we get a System.OutOfMemoryException in this method. (>10000 records throw  exception)

We are using 'RadControls for WPF Q2 2009' version.

Are there anyway to improve performance or to avoid this exception?

Best regards!

ayus
Top achievements
Rank 1
 asked on 12 Apr 2011
4 answers
445 views
Hi there, I am trying to create a behavior I can use to set the width of certain columns to 0 if certain things happen but when I try to access the AssociatedObject it is always null. I think the code will better explain this...

public static readonly DependencyProperty VisibilityProperty =
        DependencyProperty.Register("Visibility", typeof(bool), typeof(HideRadGridViewColumnBehavior),
        new PropertyMetadata(OnVisibilityPropertyChanged));
 
private static void OnVisibilityPropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
{
  if (((HideRadGridViewColumnBehavior)target).AssociatedObject == null)
  {
    MessageBox.Show("AssociatedObject is null");
  }
  else
  {
    var col = ((HideRadGridViewColumnBehavior)target).AssociatedObject as GridViewDataColumn;
    col.Width = 0;
    col.Header = "";
    col.IsResizable = false;
  }
}

It's fairly obvious what I want to do there however no matter what the AssociatedObject is null, Here is the XAML I am using - hopefully someone can point me in the right direction on this.

<telerik:GridViewDataColumn DataMemberBinding="{Binding ModelId}"  Header="ID">
  <i:Interaction.Behaviors>
    <b:HideRadGridViewColumnBehavior Visibility="{Binding Path=DevMode}"/>
  </i:Interaction.Behaviors>
</telerik:GridViewDataColumn>

Thanks alot!!!
Ivan Ivanov
Telerik team
 answered on 12 Apr 2011
3 answers
272 views
Hello,

I'm trying to add an item to the top of my treeview with a value of "Select/Deselect All" that will check all items. I have a treeview named "tvDirectory" 

I added it like this:
tvDirectory.Items.Add("Select/Deselect All");
 

Then I tried to implement the functionality in the Checked eventhandler like this:
RadTreeViewItem item = (RadTreeViewItem)((RadTreeView)sender).SelectedContainer;
if (item != null)
{
 
    if (item.CheckState == ToggleState.On)
    {
        foreach (RadTreeViewItem tvItem in tvDirectory.Items)
        {
            tvItem.CheckState = ToggleState.On;
        }
    }
    else
    {
        foreach (RadTreeViewItem tvItem in tvDirectory.Items)
        {
            tvItem.CheckState = ToggleState.Off;
        }
    }
}

But I get an "object reference not set to instance of an object for  "item". Help please, thanks.

fred williams
Top achievements
Rank 1
 answered on 12 Apr 2011
1 answer
94 views
Hi there,

I followed the ScheduleView / Drag And Drop Example but found two issues that I need assistance with.

(i) When an item is dragged from the ScheduleView back to the listbox, and the payload is directly dragged on top of a ListItem, when the drop operation completes the item disappears.
(ii) When an item is dragged to the very bottom of the listbox originating from the ScheduleView or the ListBox, when the drop operation completes the item disappears.

What changes to the OnDropQuery and OnDropInfo are required to get this to work. I'd like for an item to be able to be dragged back from the ScheduleView to the ListBox without disappearing.

I tried.to combine the Drag within a ListBox Example with the ScheduleView Drag Drop Example with no success.
Yana
Telerik team
 answered on 12 Apr 2011
0 answers
128 views
Hello Telerik Team,
                              I have one clarification about radcombobox..
I have two objects like ID and Name.The values are stored in database.I want to  retrieve these details and Display in radcomboBox

Then if i Give ID mean the drop down will open based on ID in ascending Order...(Filtering)
and also if i give Name then the drop down will open based on Name in Ascending order 

Is it possible in radcomboBox?
or How to do this?
pls give more ideas..

Thank You...
gokulnath
Top achievements
Rank 1
 asked on 12 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?