Telerik Forums
UI for WPF Forum
1 answer
278 views
In my application, I have a column in my RadGridView that is bound to a property of type 'System.Type'. When attempting to sort by this column, I get a System.ArgumentException{"At least one object must implement IComparable."}. I am not interested in wrapping the System.Type class at all to implement the IComparable(T) interface and would like to be able to provide a function delegate to the ColumnSortDescriptor to sort the types by name instead of using the default comparer as I could with a normal list.

Function CompareTypeByName(ByVal x As System.Type, ByVal y As System.Type) As Integer
  If x Is Nothing Then
    If y Is Nothing Then
      Return 0
    Else
      Return -1
    End If
  Else
    If y Is Nothing Then
      Return 1
    Else
      Return x.Name.CompareTo(y.Name)
    End If
  End If
End Function

Dim typeList As New List(Of System.Type) 
typeList.Add(GetType(String)) 
typeList.Add(GetType(Int32)) 
typeList.Sort(AddressOf CompareTypeByName)

Is there a way to do this (or something like it) currently?

Thanks,
Jason
Jason
Top achievements
Rank 1
 answered on 04 Oct 2011
0 answers
97 views
I wish to make a List of my custom objects available for the user to modify with RadGridView.
What should I do?Any example?Thx in advance.
Isilme
Top achievements
Rank 2
 asked on 04 Oct 2011
1 answer
205 views
I have a toolbar filled with buttons:

<telerik:RadToolBar >
            <telerik:RadDropDownButton >
                <StackPanel Orientation="Horizontal">
                    <Image Source="/Fdj.Eurp.GuiMain;component/Graphics/User.png" ></Image>
                    <TextBlock Text="aaa" ></TextBlock>
                </StackPanel>
                <telerik:RadDropDownButton.DropDownContent>
                    <StackPanel Orientation="Vertical" Name="spUserAccountPanel">
                        <telerik:RadButton Content="bbb"></telerik:RadButton>
                        <telerik:RadButton Content="ccc"></telerik:RadButton>
...
However after clicking one of the buttons, the whole menu does not close itself. How can I enforce it?
Petar Mladenov
Telerik team
 answered on 04 Oct 2011
1 answer
109 views
Hello All,

We have a requirement where the SelectedDate must be a Saturday only.  We are using the MVVM pattern.  I am able to change the SelectedDate property to the Saturday, however when I re-open the calendar, the last day of week the user clicked is still highlighted.  How can I remove the highlighting, even though the SelectedDate has already been changed properly.

For example, say the user clicks Oct 11 (a Tuesday), I want Oct 15 (Saturday) to be highlighted, not Oct 11.

As I mentioned, the actual SelectedDate property is set just fine, it's the highlighted date I can not figure out how to remove.

I can provide a simple test project if needed.

Here is a screenshot of the issue.  Note the Date in the control, and what's highlighted.
http://i865.photobucket.com/albums/ab216/CA-Psycho/Public/CalendarIssue.png

Thanks,
Chris
Miroslav Nedyalkov
Telerik team
 answered on 04 Oct 2011
1 answer
146 views
Hi,

can anyone tell me if it's possible for the SelectionStart/SelectionEnd properties to have 1 day of range by default, of course afetr that, the user can have the possibility the expand this range?

Thank's
Missing User
 answered on 04 Oct 2011
1 answer
75 views
Hello,
I am using rad chart in one of my application.i want to show two instances of usercontrol having rad chart in my main window.
how can i achieve it my data,title for both the charts is different

Please let me know how this could be achieved using mvvm
Evgenia
Telerik team
 answered on 04 Oct 2011
3 answers
81 views
Hi,

I have a RadTreeView with items and subitems:

All
    1
        1.1
        1.2
        1.3
    2
        2.1
        2.2
        2.3

Each subitem are associated to a RadTabControl/RadTabItem. When an item was checked in my treeview, I create dynamically a RadTabItem and when a user uncheck and item in my treeview, I remove it's associated RadTabItem from RadTabControl.

The problem is, when the user try to uncheck the item associated with the active RadTabItem in my RadTabControl, in my PreviewUnchecked event, I set the e.Handled property to true to prevent the remove of my RadTabItem in my Unchecked event.

Here is the piece of code:

 

private void radTreeViewDepartments_Unchecked(object sender, Telerik.Windows.RadRoutedEventArgs e)

 

{

 

RadTreeViewItem item = e.OriginalSource as RadTreeViewItem;

 

 

//Remove a page if it's the lowest level item and if it's not the active tab.

 

 

if (item != null && !item.HasItems && item.Tag != null)

 

{

(item.Tag

as RadTabItem).Content = null;

 

RadTabControlDepartments.Items.Remove(item.Tag);

item.Tag =

null;

 

}

}

 

private void radTreeViewDepartments_PreviewUnchecked(object sender, RadRoutedEventArgs e)

 

{

 

RadTreeViewItem item = e.OriginalSource as RadTreeViewItem;

 

 

//Check if it's not the active tab, if it's the active tab, the routedevent was stop.

 

 

if (item != null && !item.HasItems && item.Tag != null)

 

{

 

if (item.Tag == RadTabControlDepartments.Items[RadTabControlDepartments.SelectedIndex])

 

{

e.Handled =

true;

 

}

}

}


If the subitem "1.1" correspond the my active tab in my RadTabControl and the user unchecked the subitem "1" in my RadTreeView, both subitems "1.2" and "1.3" become unchecked and the subitem "1.1" stay checked but the subtiem "1" become unchecked to indicate me that all the subitems should be unchecked!!!

If I try to unchecked subitems "1.3", "1.2" and "1.1" manually, of course subitem "1.1" stay checked and the state of the subitem "1" stay correct!!!

Thank's
Petar Mladenov
Telerik team
 answered on 04 Oct 2011
5 answers
220 views
I've been looking at RadGridView for a couple of hours now and don't yet see where to start on this issue. Here's what I want to do...

I have a grid that I am using to display objects in a  BindingList. My view is watching the BindingList and creating grid rows as required. There are 7 objects in the list with 4 text fields on each. Right now, the values display as text in the grid with 7 rows x 4 columns. I need to add a special row to the top of the list that will be frozen, i.e., will not be scrolled when the user scrolls the records vertically. This row will have all comboboxes that will have a fixed number of items and will be presented as a drop list and not be editable. (As soon as I get this row in, I will have to add a second special row with all comboboxes but they will be edtiable.) The grid then should show 8 rows - my special row and the 7 rows for the items.

This all has to be done programmatically. Consider the concrete example: The program will read a delimited file and determine the number of columns that it has. It creates a new GridViewDataColumn for each. It will add the special row with each combobox having the options { int, double, string, DateTime }. And then it read the lines from the delimited file and displays them in the grid.

What I was hoping to see was a GridViewComoboxCell class so I could create a new GridViewRow and add GridViewComoboxCell(s) to the row.Items list. Alas, no such class. Also, I have set binding through the column definition as follows:

gridViewColumn.DataMemberBinding = new Binding(string.Format("[{0}]", i));

When I try to create the special row (that I cannot get to display), I get the following error when adding the row to the grid:

Indexer with specified arguments cannot be found on type GridViewRow
Parameter name: indexerArguments

This indicates that it is using the defined column binding on my new cells - and that won't work.

Suggestions on how to approach this problem would be very much appreciated.
Maya
Telerik team
 answered on 04 Oct 2011
3 answers
146 views
Hi,
I have posted my query http://www.telerik.com/community/forums/wpf/data-pager/adding-tool-tip-to-navigation-buttons.aspx.
On Sep 23, 2011. 
I am still waiting for any response.
Would Telerik team please care to respond to my query.

regards



Earthcaller
Top achievements
Rank 1
 answered on 04 Oct 2011
4 answers
203 views

Hi,

I have my grid defined as follows:

 

 

 

 

 

 

<telerik:RadGridView
            x:Name="RadGridView"
            AutoGenerateColumns="False"
            IsReadOnly="True"
            ItemsSource="{Binding VerificationPathsData}"
            SelectedItem="{Binding SelectedItem}" Loaded="RadGridView_Loaded" >
            <telerik:RadGridView.Columns>
  
                <telerik:GridViewDataColumn
                    Header="Verification Path Pair" 
                    UniqueName="VerificationPathPair"
                    DataMemberBinding="{Binding Path=., Converter={StaticResource VPPair}}"
                    />
                 <--Other COlumns follow--> 
                
I want the grid to be sorted based on this 'Verification Path Pair' column. I tried using columnsortdescrptor but that gave me error.
private void RadGridView_Loaded(object sender, System.Windows.RoutedEventArgs e)
       {
           Telerik.Windows.Controls.RadGridView rgv = (Telerik.Windows.Controls.RadGridView)sender;
           ColumnSortDescriptor csd = new ColumnSortDescriptor()
           {
               Column = rgv.Columns["VerificationPathPair"],
               SortDirection = ListSortDirection.Descending
           };
           rgv.SortDescriptors.Add(csd);
       }
Please suggest how can I have grid sorted based on this column.

Atanas
Telerik team
 answered on 04 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?