Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Can I turn off these built-in grid behaviors?
posted

I'm evaluating XamDataGrid and I think that, for our application, I would like to turn off some of the built-in functionality.  So I'm wondering how feasible / how easy each of the following customizations would be:

1.  I set AllowFixing="NearOrFar"  so that the left-most columns(s) can be fixed;  but, when I do that, I automatically see the pin icons in each column header.  I'm wondering if I can get rid of those pin icons.  My concern is that over time we'll run out of space up there, with the Sorted icon and the Filtered icon etc.  So if I need to, can I just suppress those pin icons? 
(Or, alternately, if I don't set AllowFixing,  then is there some other way to force that area at the very left -- the area to the left of the first column, the area I click in to select an entire row -- fixed?  I always want that area visible, which is why I set AllowFixing.  But maybe there's another way to force that area to always be visible?)

2.  By doing Ctrl-Clicks and Shift-clicks in various spots, I can create a, um, dis-continguous selection, if that's what you'd call it.  It looks kind of chaotic.  Can I prevent that?  Is there a selection-mode that I can set that basically says, "Only let the user select entire rows"? 

3.  Currently, if I have selected some rows by clicking in that area at the left,  and then I press PageDown, the selected rows become de-selected.  Is that behavior configurable?  I don't want PageDown to have any effect on what's selected -- I want PageDown to have the same effect as clicking in the vertical scrollbar.   Is that do-able?  

4.  By default, if I hover over a row, that row looks selected  (until I move the cursor away, obviously).  Can that automatic highlighting of whatever row the cursor is over ,  can that be turned off? 

Thanks for any info ! 

Dave

Parents
No Data
Reply
  • 69686
    Verified Answer
    posted

    Hello Dave,

    Let's get it point by point:

    1. Removing the Fixing button. If you want to remove that, you have two options - create a style for the LabelPresenter (the default you can find in the DefaultStyles directory) and collapse or remove that icon from there. Another way would be to find it programatically. You can see something similar done in this thread, but for the sorting indicator.

    2. Yes you can. This is controlled by the SelectionRecordType property of the FieldLayoutSettings object. If you want to be able to select only one continuous selection of records, you can choose Range. If you want only one record, you can choose Single.

    3. PageDown, PageUp and other keyboard navigation are associated with DataPresenterCommands. The first time you press PageDown - RecordLastDisplayed will be called, which will activate the last visible record. This is why the selection is removed. One way to go around this is to handle the ExecutingCommand event of the XamDataGrid and cancel the command, if it is RecordLastDisplayed and scroll manually. You can use something like this:

    void grid_ExecutingCommand(object sender, Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e)

          {

              if (e.Command == DataPresenterCommands.RecordLastDisplayed)

              {

                  e.Cancel = true;

                  grid.ScrollInfo.SetVerticalOffset(grid.GetRecordsInView(false).GetLength(0));

              }

          }

    4. Removing hover animation - howto you can find here. Basically, it involves removing triggers that are responsible for this animation.

    Let me know if you have further questions on there questions.

Children