Telerik Forums
UI for WPF Forum
2 answers
159 views
Hello Telerik team,

I am using a WPF rad grid {EnableRowVirtualization is set to"True"}.

I have used the GridViewToggleRowDetailsColumn column to toggle the visibility of the row details section of each row. 
I have some editable fields in the row details section like checkbox, dropdown.

On click of the expand button(+), I am populating these fields with some default values in  radGrid_LoadingRowDetails event.

I change the values in the fields and the leave the details section expanded. Then scroll down the grid so that the row move out of the window range and scroll up to the row again, the LoadingRowDetails fired again, thus reloading the fields in the details section with default values and thus the state of the fields is lost.

Is there any way to control the re-firing of the LoadingRowDetails on scroll if the row details section is already expanded.

Please provide your inputs.


Thanks,
Regards,
Mausami Sawant.

Mausami
Top achievements
Rank 1
 answered on 02 Jun 2011
1 answer
139 views
i am testing your solution from DEMO "Custom filter row" and i would like to know somethng about date filter. Why after i load my radgridview and i want to filter my datatime column i see selected date 1000 01 01 :/ i would like to see for exmple todauy day on start and selected after filter.
Marcin
Top achievements
Rank 1
 answered on 02 Jun 2011
3 answers
220 views
I will start by saying that I love the new RadTimeBar control.  It was exactly the sort of control we needed for our app that is currently under development.

As soon as I got the control, the first thing I tried was to bind PeriodStart, PeriodEnd, SelectionStart and SelectionEnd up to my ViewModel.  This hasn't worked very well though.  Binding PeriodEnd and PeriodStart in XAML would work only if I did the bindings in that order (ie: end first and then start).  Unfortunately VisiblePeriodEnd would always equal VisiblePeriodStart which always equalled PeriodStart so the user would have to stretch it out.  After adjusting VisiblePeriodEnd, it would then lock up at PeriodEnd and not be changeable any more.  In the end, I decided to set PeriodStart, PeriodEnd, VisiblePeriodStart and VisiblePeriodEnd to the required values from the ViewModel in the View's DataContextChanged event.  This set everything correctly and enabled the user to then adjust both VisiblePeriodStart and VisiblePeriodEnd.

Anyway, on to my main issue.  I am binding SelectionStart and SelectionEnd in XAML to my ViewModel and it works kinda ok but not really great.  My ViewModel validates the date range selection that the user has asked set using the TimeBar and then stores the validated value instead of the user requested value.  The problem I have is that if the user selects a date range with the TimeBar that when validated results in the same values that are already stored, even though I raise the PropertyChanged events for the properties that SelectionStart and SelectionEnd are bound to, the visual selection on the screen does not update (ie: revert to the previous values that were valid) and instead keeps the user requested values.   I don't see this as as a bug as such as I can see you guys developed the control with it's own validation, but if this is a feature that could be added it would be much appreciated.  For now, as our app is still under development, we are ok with releasing the current functionality to our beta testers as is, but we'd love to have this changed if possible.  In fact, I would love it if I could bind to the ViewModel not just SelectionStart and SelectionEnd but PeriodStart and PeriodEnd as well.

Hope that all made sense =)

Cheers,

Nick Barrett
Tsvetie
Telerik team
 answered on 01 Jun 2011
8 answers
213 views
Hi I can see this from your release notes "Ability to see which item was checked initially in tri state mode"  here http://www.telerik.com/versionnotes.aspx?id=2268

any info on how to use this ?

Best regards
Kristján.
Petar Mladenov
Telerik team
 answered on 01 Jun 2011
2 answers
446 views
Hi,

I'm fairly new to playing with the RadRichtextBox and am wondering if anyone would know how to get around this problem.  I am programatically formatting font and then adding text to a Rich Text Box like so (richTB is a RichTextBox decalred in the XAML):

richTB.DocumentInheritsDefaultStyleSettings = true;
richTB.FontSize = 11;
 
Section sec = new Section();
 
Span sp = new Span();
sp.Text = "Some Text I want to write to RTB";
 
Paragraph par = new Paragraph();
par.Inlines.Add(sp);
 
sec.Blocks.Add(par);
 
richTB.Document.Sections.AddBefore(rtb.Document.Sections.First, sec);

Now, this works fine, the text appears at the start of the RichTextBox.  My problem is that if I move the cursor to the next line, the font changes to something bigger (default font size of original Section).  I've tried to remove all section of the document using:

richTB.Document.Sections.Clear();

Before writing the text I want to write to the RichTextBox but this call causes an exception (Object reference not set to an instance of an object.). Why can't I clear the collection? 

Is there something wrong with removing sections?  If there is, is there a way I could just change the font of the original section to use what I defined for the RadRichTextBox?  That is my real problem.

Thanks,

-- Joel



Joel
Top achievements
Rank 1
 answered on 01 Jun 2011
1 answer
53 views
I noticed the following behavior after updating from Telerik version 2010.3.1110.40 to 2011.1.0419.40:

When a GridView is placed in a RadPane (they are docked as documents) and RadPaneGroup.AllowDragReorder = true

a) the GridView filter menu closes if you try to klick any control in it without the control reacting correctly. For example, if you try to click a checkbox, the checkbox doesn't get checked/unchecked and the menu closes. The only exception are comboxes: They can be opened but you can't select any item in it.

b) the horizontal GridView scrollbars don't scroll anymore (only in very small increments and this occurs only when dragging the scroll marker) or scroll the GridView content vertically all of a sudden.

If I set "RadPaneGroup.AllowDragReorder = false" everything seems to be fine.
Yordanka
Telerik team
 answered on 01 Jun 2011
1 answer
191 views
I would like to completely create my docking control and the panes inside dynamically at runtime. For some reason I am having a difficult time understanding the parent/child relationship of some of these controls. What I am looking to do is to create a docking control with evenly sized panes that can be used in a dashboard type screen. Meaning it would layout more like a grid. However, the client could re-arrange and save the layout however he/she desired. Are there any c# examples that I could draw from?

As an example this code throws an error. The only thing that is static xaml is the HomPageDocking control.

RadSplitContainer splitContainer = new RadSplitContainer();
WebBrowser browser = new WebBrowser();
browser.Navigate("http://www.facebook.com");
RadPane browserPane = new RadPane();
browserPane.Header = "Facebook Widget";
browserPane.Content = browser;
splitContainer.Items.Add(browserPane);
this.HomePageDocking.Items.Add(splitContainer);


 

Rod

Konstantina
Telerik team
 answered on 01 Jun 2011
5 answers
286 views
I'm applying the Windows7 theme to the standard listbox so that it's appearance blends in with the rest of my application, but I'm finding something super annoying. I can't get rid of the vertical scrollbar. I've tried setting the scrollviewer properties, but the don't make any difference. No matter how many items I have in my listbox, it shows the scrollbars. When I don't apply the theme, it only shows the scrollbar when the # of items is greater than the height of the box.

How do I get that auto visibility back?
Rayne
Top achievements
Rank 1
 answered on 01 Jun 2011
5 answers
148 views

Hi,

I have a hierarchy gridview where the rows in each childgrid have a column with a checkbox for its value.  When the user clicks on that checkbox, I want that child row to enter the parent grid and that child's parent to enter the child grid.  In other words, I want to flip-flop the parent row and selected child row.

My problem is I am having trouble finding an event that captures what child row was selected and if they indeed checked off the check box.

I tried to provide screenshots, but I'm having some trouble pasting them into this message.  Not sure if it's possible to do so.

Please let me know if you need any additional information.

Thank you,
Joe

 

Ivan Ivanov
Telerik team
 answered on 01 Jun 2011
2 answers
339 views

I'm wondering how the filters in RadGridView work. How do they check for equality?

 

After some experimentation it seems that they check for "referential equality" (is that what is it called??), that is the filter checks if the rows have exactly the same object as the filter. So even if a column shows a custom type of mine and I have implemented the Equals() method, it won't matter.

 

Lets say I have a custom type representing a customer:

public class Customer : IComparable
{
    public int Id { get; set; }
    public string Name { get; set; }
 
    public Customer(int id, string name)
    {
        Id = id;
        Name = name;
    }
 
    public override string ToString()
    {
        return Name;
    }
 
    public virtual int CompareTo(object obj)
    {
        Customer otherCustomer = obj as Customer;
        if (otherCustomer != null)
        {
            return this.Id.CompareTo(otherCustomer.Id);
        }
        else
        {
            throw new ArgumentException("Can only compare to other Customer instances.");
        }
    }
 
    public override bool Equals(object obj)
    {
        if (obj.GetType() == typeof(Customer))
        {
            Customer otherCustomer = (Customer) obj;
            return otherCustomer.Name == Name;
        }
        else
        {
            return false;
        }
    }
 
}


I'm using MVVM and each row displayed in the gridview has a viewmodel. This viewmodel has the following code:

private Customer _contact;
public Customer Contact
{
    get
    {
        return _contact;
    }
    set
    {
        if (value != _contact)
        {
            _contact = value;
            OnPropertyChanged("Contact");
        }
    }
}
 
public BindingList<Customer> AllContacts { get; private set;}

The row-viewmodel has a property called "Contact" that is of my custom type. It also has a BindingList of the same type that will contain all available contact/customers.

And in my XAML I have this code:

<tgv:RadGridView ItemsSource="{Binding Path=MyData, Mode=OneWay}" >
    <tgv:RadGridView.Columns>
         
        <!-- Columns excluded for brevity... -->
         
        <tgv:GridViewDataColumn Name="ContactColumn"
                              Header="Contact"
                              DataMemberBinding="{Binding Path=Contact}">
            <tgv:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Contact.Name, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
                </DataTemplate>
            </tgv:GridViewDataColumn.CellTemplate>
            <tgv:GridViewDataColumn.CellEditTemplate>
                <DataTemplate>
                    <ti:RadComboBox ItemsSource="{Binding Path=AllContacts, Mode=OneTime}"
                                  DisplayMemberPath="Name"
                                  SelectedItem="{Binding Path=Contact, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </DataTemplate>
            </tgv:GridViewDataColumn.CellEditTemplate>
        </tgv:GridViewDataColumn>
    </tgv:RadGridView.Columns>
</tgv:RadGridView>

As you can see the column that shows the contact binds to the property Contact on the row-viewmodel. In the cell edit template there's a ComboBox that allows the user to choose one contact from the list with all contacts.

 

"MyData" that the gridview is bound to is a QueryableCollectionView that has all the rows (row-viewmodels) that are to be displayed. It is created something like this:

RadObservableCollection<DataRowViewModel> myDataRows = new RadObservableCollection<DataRowViewModel>();
//...Here would be some code to fill myDataRows with row-viewmodels...
MyData = new QueryableCollectionView(myDataRows);

 

All this works fine.

 

Now I want to apply filtering on that column by code. Let's say that there are ten available customers. If I open the filter popup on the gridview all ten are displayed in the list of checkboxes where you can specify which ones to show. These are the "distict filters". To apply distinct filters in code behind I would do something like this:

MyData.FilterDescriptors.Clear();    //Clear old filters
ColumnFilterDescriptor cfd = new ColumnFilterDescriptor(ContactColumn);
FilterDescriptor fd = new FilterDescriptor();
fd.Member = "Contact";
fd.Operator = FilterOperator.IsEqualTo;
fd.Value = new Customer(1, "David");
fd.IsCaseSensitive = true;
cfd.DistinctFilter.FilterDescriptors.Add(fd);
MyData.FilterDescriptors.Add(cfd);

When I run this I see that a filter is applied, but all my rows are removed by the filter, even those that has Id=1 and Name=David.

 

I have tried a different model where I don't create a new Customer and put in the Value of the filter but instead put an instance of Customer that is actually in the list AllCustomers. When I do this it works fine. The filter removes all rows except those who has that specific customer (David) as customer. This leads me to think that the filter checks equality by checking "referential equality" and does not use the Equals method.

 

Am I right in this assumption or is it something else I'm missing?

haagel
Top achievements
Rank 1
 answered on 01 Jun 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
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?