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
80
Blank rows in xamdatagrid
posted

We have a grid in our applications showing varying numbers of items depending on the status of our instrumentation.  The space taken by this grid is fixed, and often there are not enough records to fill the whole vertical span of the grid.  We would like the column separators and the row colour alteration to continue to the bottom of the available space even if there aren't enough records to fill those rows, but we don't want to simply add blank records to the grid since it can affect how the data appears with the columns are sorted.  Is there any built in way to accomplish this, or will we have to code the behaviour in ourselves?

  • 16495
    Offline posted

    Hello Tyler,

     

    Thank you for your post.

     

    I have been investigating you requirements. Currently  the XamDataGrid control does not support built-in  functionalities that you try to achieve.

     

    What I can suggest about the functionality for columns separator is to create style for LabelPresenter. In it you can use EventSetter to handle the Loaded event. Inside in the event handler of Loaded you can handle the LayoutUpdated event of LabelPresenter. By using LabelPresenter and our Utilities class you can get the Grid that is child of XamDataGrid and add to it Canvas panel that contains Rectangle. To set the position of the Rectangle you can use SetTop and SetLeft methods of Canvas panel. To determine how much should be the offset of left side for each columns separator, you can use the  TranslatePoint method of LabelPresenter. From the following link you can read more details about it:  https://msdn.microsoft.com/en-us/library/system.windows.uielement.translatepoint%28v=vs.110%29.aspx .  I created short sample application based on your scenario to show you how you can implement this functionality.

     

    About the functionality for alternating records to fill the whole vertical available space, if you want this functionality to be implemented for a future version of the XamDataGrid I can suggest submitting a new Product Idea, also you can include and functionality for the column separator.

     

    Steps to create your idea:

                   

    1.            Log into the Infragistics Product Ideas site at http://ideas.infragistics.com (creating a new login if needed).

    2.            Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)

    3.            Add your product idea and be sure to be specific and provide as much detail as possible.

                 Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!

                 Include a link to this thread in your idea so product management will be able to look back at this case. 

     

    The benefits of submitting the product idea yourself include:

    -              Direct communication with our product management team regarding your product idea.

    -              Notifications whenever new information regarding your idea becomes available.

     

    Additional benefits of the Product Idea system include:

     

    -              Ability to vote on your favorite product ideas to let us know which ones are the most important to you.  You will have ten votes for this and can change which ideas you are voting for at any time.

    -              Allow you to shape the future of our products by requesting new controls and products altogether.

    -              You and other developers can discuss existing product ideas with members of our Product Management team.

     

    The product ideas site allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    BlankRows.zip