Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,351 total)
  • Author
    Posts
  • Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Zappo,

    To change the key used for the BeginEditCommand, you have to modify the InputGestures collection for the command.

    For example:

    DataGridCommands.BeginEdit.InputGestures.Add( new KeyGesture( Key.Enter, ModifierKeys.None ) );

    However, keep in mind that the Enter key is already used for the EndEdit command, and adding it to the BeginEdit command will cause changes to the default behavior. One side effect is that the Enter key will no longer work as expected to end the edit, as it is caught by BeginEdit before hand. You will have to make other adjustments, and some behaviors may not be possible without modifications to the source code (which you could do if you have a Blueprint subscription, as it includes the source code).

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Amplitude,

    The question needs precision since lots of manipulation could be done on the data between the data source and the final output. Converters could be set on bindings to alter the data, templates could be used to alter the visual display, culture and string formats could convert values to string differently, etc.

    However, no matter your answer, our answer will probably be that it is not possible because the grid is doing UI virtualization. In such case, the number of cells is limited to the viewport.

    It is possible to disable UI virtualization, but the grid’s performance will most probably suffer. The initial question remains, what is the “data from the grid”? There is the data from the data source, the data from the cell’s content, the data from the cell’s viewer or cell’s editor, etc.

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi B.O.B.,

    After verification with a developer, the DataGrid does not support the ability to display the child grid’s ColumnManagerRow at the master level the way you describe it.

    The only suggestion I could make would be to hide the ColumnManagerRow in the details, and manually add your own custom row to the FixedHeaders to act as a header row for the details.

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi B.O.B.,

    To hide the details’ toggle button when the master has no details, you would have to redefine the DataRow’s ControlTemplate and hide the detailsToggleButton based on the DataRow’s HasChildItems property. In here you would have to handle the click event of your toggle button and redefine the template accordingly.

    The reason why the datagrid isn’t able to do it automatically, is because the datagrid doesn’t know about the details in advance. It doesn’t know if there are child elements or not, because it’s only when the expand button is clicked that the detail data source is actually created.

    You can use one of our Row templates found in our included theme files. Default location:
    C:\Program Files (x86)\Xceed\Xceed DataGrid for WPF v#.#\Themes

    For example, the “tableflowViewRowTemplate” control template found in the following file:
    C:\Program Files (x86)\Xceed\Xceed DataGrid for WPF v#.#\Themes\Aero\TableflowView.Aero.normalcolor.xaml

    Example of a click handler to expand/collapse the selected item:

    
      private void detailsToggle_Click(object sender, RoutedEventArgs e)
      {
          var selectedItem = this.PeopleGrid.SelectedItem;
          if (selectedItem != null)
          {
            if (expanded)
            {
                PeopleGrid.CollapseDetails(selectedItem);
                expanded = false;
            }
            else if (!expanded)
            {
                PeopleGrid.ExpandDetails(selectedItem);
                expanded = true;
            }
          }
      }
    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi,

    For the ItemScrollingBehavior=”Deferred” not working, I forgot that in the case of TableflowView, the TableflowView.IsDeferredLoadingEnabled property must be set to “false” or the deferred scrolling behavior will not kick in.

    For the PageSize being set at a later time, we do not see any issue. Setting the property like this is expected to work:

       var collectionView = (DataGridVirtualizingCollectionView)grid.ItemsSource;
       collectionView.PageSize = 50;

    By default, the page size is of 200. Changing the page size to 50 means that the DataGridVirtualizingCollectionView will require items in blocks of 50 items instead of 200 to the remote data source. Within the collection view, the cache size (DataGridVirtualizingCollectionView.MaxRealizedItemCount) will remain unchanged. By default, this cache size is of 1000 items.

    Instead of having 5 pages of 200 items (5 * 200 = 1000) in cache, it will contain 20 pages of 50 items (20 * 50 = 1000) in cache.

    Keep in mind that the page size is a property of DataGridVirtualizingCollectionView. It is a collection view feature and not a grid feature. The grid will always display items in a scrollable fashion.

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi,

    Unfortunately, there is not a lot of ways to configure the behavior beyond the PageSize, PreemptivePageQueryRatio and MaxRealizedItemCount properties.

    The DataGridControl and the DataGridVirtualizingCollectionView are 2 different beasts. The DataGridControl displays rows and asks data items to the DataGridVirtualizingCollectionView, while the DataGridVirtualizingCollectionView requests data items to the remote data source by rising some events. The collection view is not aware of what is displayed on screen. It is not its duty to know about such things.

    Since the DataGridControl may request some items near the last item requested, the DataGridVirtualizingCollectionView has a concept of caching and preemptive fetching. The properties that alter the behavior are PageSize, PreemptivePageQueryRatio and MaxRealizedItemCount. Basically, the PageSize tells how many items are contained in a cached page. If the DataGridControl asks for a single item, the collection will query a full page containing the item to the remote data source. The PreemptivePageQueryRatio tells the collection view when to query for a page next to the current one so the grid may wait less before displaying data while scrolling near the current page. The MaxRealizedItemCount indicates the collection view cache size. For example, a MaxRealizedItemCount of 1000 items for a PageSize of 200 items tells the collection view to keep 5 pages of items (mostly 5 QueryItems request) in cache all the time.

    In the previous configuration, scrolling down will request pages of items to the remote data source. Since there is about 5 pages that fits in cache, the collection view will start aborting item queries on the 6th page request while there is still 5 requests pending. Lowering the number of page allowed in cache will abort items query sooner. However, lowering the number pages in cache also means that scrolling up and down has more chance to requery the same pages since any previously cached page may have been kicked out of cache.

    If you scroll with the thumb, setting the DataGridControl.ItemScrollingBehavior property to ItemScrollingBehavior.Deferred will lower the number of requests since the grid will wait for the thumb to be released before requesting data items.

    Since you are the one who is converting the collection view requests into queries to your data source, you may throttle the queries and reorder them as long as you tell the collection view that query result will be given back asynchronously (set the event args IsAsync property to true).

    If you tell that the query result is going to be asynchronous, you have control about when you send the queries to your data source. For example, while scrolling, the collection view may ask for pages 1, 2, 3, 4, 5. Nothing prevents you from throttling the queries and queue them up so only one is done at a time on your data source. You are also in control of the query order.

    For example, on your side, you may decide that you will always wait 100 milliseconds before querying your data source. If within that 100 ms, the collection view requested pages 1, 2 and 3, you may decide to only execute the query for page 3 and put the other 2 in a queue. You may also decide to query your data source right away, but only do it 1 request at a time. After the query to your data source returns, you will just pick one of the remaining query in queue and launch it. However, if in the mean time, the collection view request pages 4 and 5, you may also put them in the queue and always decide to execute to most recent one. That way, you give more chance to the collection view to abort old queries.

    The final sequence could look like this:
    – The collection view requests pages 1, 2 and 3.
    – You execute the query for page 3 on your data source since it is the more recent one.
    – In the meantime, the collection view requests pages 4 and 5. You are still executing the query for page 3 while the queue now contains queries for pages 1, 2, 4 and 5.
    – After you’ve got the result for page 3, you send it back to the collection view, dequeue one of the query and launch it on your data source.
    – Since query for page 5 is the most recent one, you dequeue it and launch it. While it is being executed on your data source, the collection view has the result for page 3 and your queue still contains queries for pages 1, 2 and 4.

    Even though the query for page 1 was the first requested by the collection view, it will probably be the last one executed on the remote data source. If the grid is still scrolling, it will probably ask for page 6, 7, 8 and such. From the collection view’s perspective, the query for page 1 is still running, but may no longer be required since the target page may no longer fit in cache. In such case, it will be aborted. In your case, when this happens, since the request for page 1 is still in your queue, you will only have to remove it from it and ignore it. This will probably improve the application performance since it will ignore some queries and give back results for more recent queries quicker.

    In the example, only one query is being executed on the remote data source at a time. You have the choice. You may execute 1 at a time, 2 at a time, or even all. In your scenario, it seems that requesting too many queries at a time has a negative impact. Throttling seems to be a good idea in your case.

    Diane [Xceed]
    Moderator
    Post count: 1353

    Where do you want to pass the SelectedObject as a Command parameter?
    Could you provide an example? Thank you.

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi kmarois,

    You can use the AdvancedOptionsMenu to define your ContextMenu:

    <xctk:PropertyGrid SelectedObject="{Binding}">
          <xctk:PropertyGrid.AdvancedOptionsMenu>
            <ContextMenu>
              <MenuItem Header="Menu item 1" />
              <MenuItem Header="Menu item 2" />
              <Separator />
              <MenuItem Header="Menu item 3" />
            </ContextMenu>
          </xctk:PropertyGrid.AdvancedOptionsMenu>
    </xctk:PropertyGrid>
    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi peterj,

    Yes this is a known issue, the bug will not happen on Windows 8 and up. Other OS however might have the problem.

    It has already been fixed, and the fix will be included in the next release (v3.7).

    In the meantime, if you have access to the code, you can use the following Brush for the DropDownBackground property in the style for “ColorPicker”, in file Xceed.Wpf.Toolkit/ColorPicker/Themes/Generic.xaml :

       <Setter Property="DropDownBackground">
          <Setter.Value>
             <LinearGradientBrush EndPoint="0.5,1"
                                  StartPoint="0.5,0">
                <GradientStop Color="#FFFAFBFB"
                              Offset="0" />
                <GradientStop Color="#FFF4F4F4"
                              Offset="1" />
             </LinearGradientBrush>
          </Setter.Value>
       </Setter>
    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Darren,

    Here is the developer’s suggestion:

    —-
    You could always define a new custom WizardPage for each of your page. You would end up with multi xaml/xaml.cs files and each of them could be previewed in the Visual Studio Designer. You could then add each of theses pages in a list of WizardPage, which would be the Wizard.ItemsSource.
    —-

    You could do it manually by changing the index (in CurrentPage) to preview the Wizard page in the Designer.

    However, the developer’s suggestion has the possibility to separate each Wizard page from on another, and easily get back to a page without modifying an index in the XAML. On the other hand, many new XAML files will be added, but they can be stored in a folder in the Visual Studio Solution Explorer.

    Diane [Xceed]
    Moderator
    Post count: 1353

    The following is fixed in the latest release (v6.5):

    “A NullReferenceException is no longer thrown by the TextBlockLite control.”

    Download link:
    http://forums.xceed.com/latest-xceed-datagrid-for-wpf

    Diane [Xceed]
    Moderator
    Post count: 1353

    The following is fixed in the latest release (v3.6).

    “In UI Automation, the WatermarkTextBox now uses the Value pattern for the Text part.”

    Download link:
    http://forums.xceed.com/latest-xceed-datagrid-for-wpf

    Diane [Xceed]
    Moderator
    Post count: 1353

    The fix was included in the latest release (v3.6)

    Download link:
    http://forums.xceed.com/latest-xceed-toolkit-plus-for-wpf

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi bohannjn,

    You need to provide a custom DataGridGroupDescription in order to accomplish this.

    See the “Custom grouping” code snippet on the following page for an example on how to do this:

    http://forums.xceed.com/wp-content/documentation/xceed-datagrid-for-wpf/webframe.html#How-to%20Grouping%20Data%20Items.html

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi peterj,

    Thank you for the bug report. The fix will be included in the next release. Thank you for your patience.

Viewing 15 posts - 1 through 15 (of 1,351 total)