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
265
UltraGrid Header Settings not working as expected....
posted

Hi,

    I have a UltraGrid control in which, I am trying to do a few things as mentioned below...

I have an ultraGrid and ultraDataSource which are initialized and assigned to in the InitializeComponent() method of the parent. I have created individual dictionaries for UltraDataColumn and UltraGridColumn respectively.

- Firstly, I populate the Columns names array

- Secondly, I populate the data which is an array of class objects. 

- Then I create a UltraDataColumn dictionary from the Columns array; but do not yet add it to UltraDatasource

- Next I create another dictionary of corresponding UltraGridColumns from the dictionary of UltraDataColumns, but do not yet add it to UltraGrid

- Since, now the column collections are ready and since the UltraDataSource is already bound to UltraGrid, the Grid Columns collection already has the column information

- Now, add the UltraGridColumns to UltraGrid and then add the UltraDataColumns to UltraDataSource. 

- In Initialize_Layout event handler, I initialize layout, band and provide values to overrides and also format headers looping through the UltraGrid's column collection

- In the Initialize_Layout, I am trying to set the 0th column that serves as row header as a Fixed Column, which is always visible and remains in position on scrolling. I have set Fixed property to true, FixedColumnIndicators to None yet the column does not fix itself. I have tried this setting in RowLayoutMode as GroupLayout as well as COlumnLayout respectively. But it still fails....

- I am able to set the appearance for the headers in Initialize_Layout. Everything, except BackColor is rendered properly. I have tried to find out as to what is causing the problem; 

- I have multiple Ultra tabs on the UI and each tab has an UltraGrid. I am doing custom drawing of +/- signs in column headers to implement expandable Columns. I have assigned a creation filter to the grid. With some deal of research, I am able to provide +/- buttons in headerUI. However, the UltraGrid custom drawing is lost when the tab is changed and the same ultra Grid is shown again and it does show the grid without any formatting...

- Is there a way to fire InitializeLayout on purpose? 

Please advice if I am doing anything wrong...

Thanks, 

Bhushan. 

Parents
  • 23930
    Verified Answer
    Offline posted

    Hi Bhushan,

    Thank you for posting in our forums.

    • For the fixed headers, if they aren’t working, you probably need to set the UseFixedHeaders property of the DisplayLayout to true:

      this.ultraGrid1.DisplayLayout.UseFixedHeader = true;

    • For the Header color it is probably overridden by the style that the header uses. In order to override this use the following line:

      this.ultraGrid1.DisplayLayout.Override.HeaderStyle = HeaderStyle.Standard;

    • As for the CreationFilter, there really isn’t a way for me to know what is going on, unless I see your application. Most probably there is some issue in your CreationFilter, but without seeing it there is now way to know exactly what.

    • What do you mean by “Is there a way to fire InitializeLayout on purpose”? The event is fired when the grid is provided with a data source. If you want to call the code inside it multiple time, encapsulate the code inside the event in a method and then call the method.

    Please let me know if you have any additional questions.

Reply Children