Telerik Forums
UI for WPF Forum
3 answers
105 views
I'd like to have the pagesize for the data pager be dependent on how many items can fit in the gridview without scrolling. I'm assuming I can write code to do this, but was wondering if there might be a better way.
Vlad
Telerik team
 answered on 15 Jul 2011
2 answers
192 views
Hi,


I have a DataTable with numeric data that is bound to a RadGridView. When I sort a column by clicking the grid's header it is sorted by that column which is correct. The problem is that the sort applied to the column is a string sort and I would like it to sort numerically. I looked in the grid documentation under Sorting to no avail. Could you please tell me how this is done?


Best Regards,
Jose
Jose Simas
Top achievements
Rank 2
 answered on 15 Jul 2011
9 answers
116 views
Let DoubleValue be a non primitive type wrapping a double, with a TypeConverter attached that knows how to convert it from/to a Double, and suppose a GridViewDataColumn is bound via DataMemberBinding to a property of this type. Editing the value causes an InvalidCast exception, from String to DoubleValue, in GridViewDataControl.OnKeyDown. Although the exception is captured internally, it is still visible in the Output window of VS.

Going through a ValueConverter in the DataMemberBinding does not make a difference here: the same exceptions are still raised.

The internally raised exceptions are unpleasant and can cause problems with e.g. copy/paste, which I have noted in separate post.

jose
Top achievements
Rank 1
 answered on 15 Jul 2011
6 answers
180 views
Using a RadComboBox on a UserControl; compiled on Win7 x64 using VS2010 and executed on a WinXP. When the drop down on the combo box is activated the contents is behind the dialog box.

This is limited to a UserControl opened in a RadWindow

  RadWindow host = new RadWindow();
  host.Content = (new UserControl1());

If the UserControl1 contains a ComboBox then the dropdown appears behind the UserControl1 window.
George
Telerik team
 answered on 15 Jul 2011
1 answer
182 views
Greetings,

I've taken an interesting approach to binding in the RadGridView in order to meet some business requirements. Specifically, I'm extending my bound object from System.Dynamic.DynamicObject in order to dynamically "add" properties to the object at run time based on user selection. Here's a simplified version of my bound object:

public class GridItem : DynamicObject, INotifyPropertyChanged
{
    public GridItem(DateTime dateTime, decimal value)
    {
        _dateTime = dateTime;
        _value = value;
    }
 
    //NOTE: The DateTime property is private forcing the GridView to use the DynamicObject implementation...
    private readonly DateTime _dateTime;
    private DateTime DateTime
    {
        get { return _dateTime; }
    }
 
    //NOTE: The Value property is private forcing the GridView to use the DynamicObject implementation...
    private decimal _value;
    private decimal Value
    {
        get { return _value; }
        set
        {
            _value = value;
 
            OnPropertyChanged("Value");
        }
    }
 
    public override bool TryGetMember(GetMemberBinder binder, out object result)
    {
        result = null;
 
        switch (binder.Name)
        {
            case "DateTime":
                result = DateTime;
                break;
 
            case "Value":
                result = Value;
                break;
        }
 
        return true;
    }
 
    public override bool TrySetMember(SetMemberBinder binder, object value)
    {
        switch (binder.Name)
        {
            case "Value":
 
                decimal result;
                if(decimal.TryParse(value.ToString(), out result))
                {
                    Value = result;
                }
 
                break;
        }
 
        return true;
    }
 
    private static readonly IEnumerable<string> _members =
         new List<string>() { "DateTime", "Value" };
 
    public override IEnumerable<string> GetDynamicMemberNames()
    {
        return _members;
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
    private void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged == null)
            return;
 
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}

I add the items to my GridView using:

this.GridView.ItemsSource =
     new List<GridItem>()
          {
               new GridItem(DateTime.Parse("1/1/2009"), 10.9m),
               new GridItem(DateTime.Parse("3/31/2010"), 11.4m),
               new GridItem(DateTime.Parse("5/1/2011"), 12.5m),
          };

And my Grid is defined as such:

<Telerik:RadGridView x:Name="GridView" AutoGenerateColumns="False">
     <Telerik:RadGridView.Columns>
          <Telerik:GridViewDataColumn UniqueName="DateTime" Header="Date/Time"
               DataMemberBinding="{Binding DateTime}" IsReadOnly="True"
               DataType="{x:Type System:DateTime}" IsFilterable="True" />
          <Telerik:GridViewDataColumn UniqueName="Value" Header="Value"
               DataMemberBinding="{Binding Value}" DataType="{x:Type System:Decimal}"
               IsFilterable="True" />
     </Telerik:RadGridView.Columns>
</Telerik:RadGridView>

The approach works great for binding; however, the column filtering does not work. It seems to be broken when there's not a public property exposed.

I'm using the Q3/2010 Telerik controls.

Any help or work around would be appreciated. We must have column filtering.

Thanks a bunch.
Rossen Hristov
Telerik team
 answered on 15 Jul 2011
1 answer
221 views
Hi
In gridview filter option you can see drop down always start with "Is Equal To" is it possible to change to "Contains", i do not want to do any custom filters as i like inbuilt filters and just want to change filter drop down option to selected " Contains " option only, so if i want to filter something in column i just enter value and press "Filter" button and filter will filter value based on "Contains" option.



Kind Regards:
Dimitrina
Telerik team
 answered on 15 Jul 2011
3 answers
132 views
Hi there,
I have a GridViewComboBoxColumn in a nested hierarchical GridView, but somehow I can't set ItemsSource, DataMemberBinding and SelectedValueMemberPath properly from XAML. So, is there a simple way to find out, which ItemsSource is really set in the nested Grid at runtime, in order to fix the other props?
btw, my error looks like
BindingExpression path error: 'Name' property not found on 'object' ''Char' (HashCode=5177423)'. BindingExpression:Path=Name; DataItem='Char'
Cheers,
Hermann
Dimitrina
Telerik team
 answered on 15 Jul 2011
5 answers
261 views

I am using wpf 4.0 and telerik (3rd party tool) in my application and in which using grid of telerik.Now in my application there is a requirement that if the screen resolution gets bigger than 1024*768 then the columns width should increase.So i gave column width as star (*).

But in case of more than 20 columns in one grid................all the columns get collapsed with each other and though I have done the ScrollBar visibility as auto...............I dont see the scroll bar.So kindly tell me what should be the correct way to define width for the column.

Ramesh
Top achievements
Rank 1
 answered on 15 Jul 2011
2 answers
62 views
I want to binding SumFunction with a textblock. But I don`t how to do it. Here is my XMAL Code:

telerik:GridViewDataColumn Header="Amount" UniqueName="Amount" DataMemberBinding="{Binding Amount}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:SumFunction x:Name="MyTotal" Caption="Sum:" SourceField="Amount" />
                </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>



 <TextBlock Height="23" HorizontalAlignment="Right" Margin="0,28,98.377,0" x:Name="textBlock1" Text="{Binding "Need something to do", ElementName=radGridView1}" VerticalAlignment="Top" TextInput="textBlock1_TextInput" Width="79" d:LayoutOverrides="VerticalAlignment" />


thank`s for Help
Md.Hasanuzzaman
Top achievements
Rank 1
 answered on 14 Jul 2011
13 answers
306 views
Hi,

I faced with a problem that RadTreeListView.ScrollIntoView() doesn't works at all.

I need your support or workaround if so exist asap.

Thank you in advance,
Julian
Maya
Telerik team
 answered on 14 Jul 2011
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Rating
SplashScreen
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?