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
215
TemplateAddRowAppearance and AddRowAppearance
posted

In the InitializeLayout event for a UltraWinGrid, I have the following:

        e.Layout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop
        e.Layout.Override.TemplateAddRowAppearance.BackColor = Color.Yellow
        e.Layout.Override.AddRowAppearance.BackColor = Color.Orange

The templateaddrow at the top of the grid has a yellow background.  My understanding is that once keying begins or clicked in,  the templateaddrow becomes and addrow, but the row doesn't change to orange as set above. The background of the cells in the addrow become the same color as the rest of the grid.

Also after typing info into the addrow and pressing ENTER, the new row is added to the grid, and a new template is added at the top, but the background color is the same as the rest of the grid (not yellow). If instead of pressing enter on the addrow, I tab through to after the end of the addrow, it is added to the grid and the new template addrow becomes yellow...why doesn't pressing ENTER do the same?

One last thing, the comments above apply to a default grid that has no preset applied.  If I apply a preset, none of the settings above apply. For example, applying "Silver Gradients - Blue Accents.xml", I get blue grid rows with at darker shade of blue for the templateaddrow. When I begin keying I get a lighter shade of blue (lighter than the normal rows), and when I press ENTER the row is added to the gird and the templateaddrow become the darker shade again.  All thiis seems correct except I would have expected my overrides above to be appled. Seems as though the overrides don't apply when a preset is applied.  Is that correct behavior?

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

     

    lthibx said:
    The templateaddrow at the top of the grid has a yellow background.  My understanding is that once keying begins or clicked in,  the templateaddrow becomes and addrow, but the row doesn't change to orange as set above. The background of the cells in the addrow become the same color as the rest of the grid.

    I just tested this out using the latest service release of NetAdvantage 2007 Volume 2, and it works fine for me. As soon as I begin typing into the TemplateAddRow, it turns orange.

    lthibx said:
    Also after typing info into the addrow and pressing ENTER, the new row is added to the grid, and a new template is added at the top, but the background color is the same as the rest of the grid (not yellow). If instead of pressing enter on the addrow, I tab through to after the end of the addrow, it is added to the grid and the new template addrow becomes yellow...why doesn't pressing ENTER do the same?

    You are correct. ENTER should behave exactly the same way. And in my test just now, it worked fine.

    It sounds to me like you are using an old version of the grid and you need to get the latest service release.

     

    lthibx said:
    One last thing, the comments above apply to a default grid that has no preset applied.  If I apply a preset, none of the settings above apply. For example, applying "Silver Gradients - Blue Accents.xml", I get blue grid rows with at darker shade of blue for the templateaddrow. When I begin keying I get a lighter shade of blue (lighter than the normal rows), and when I press ENTER the row is added to the gird and the templateaddrow become the darker shade again.  All thiis seems correct except I would have expected my overrides above to be appled. Seems as though the overrides don't apply when a preset is applied.  Is that correct behavior?

    Applying a Preset to grid just sets properties. It's a one-time operation where the grid properties are set based on the information in the preset file.The grid has no notion of the fact that a preset was applied. So there's no way a preset can override any properties you set on the grid, as long as you set them after the preset is applied.

    In theory, I suppose a preset could affect settings that you apply if the preset sets some other property that you are not setting. For example, a Preset might turn off HotTracking, thus preventing you from seeing any of the HotTrackingAppearance colors that you applied. But that doesn't seem to be the case here, since there's no property for turning off the AddNewRow or TemplateAddRow appearances.

Children
No Data