Ticket Q450528
Visible to All Users

How can I resize a single row in DevExpress XtraGrid (Winforms)?

created 12 years ago

When I try to resize a single row, all rows are resized, I want to make sure that only a single row is resized when I use my pointer to increase row's height. Can anyone tell me how to accomplish that? I'm using DevExpress DXperience 12.1.

Extra Info:
The grid has properties: AllowRowSizing and RowAutoHeight. Setting AllowRowSizing to "true" enables the user to click and resize the row of the gridview but, when the row is droped, all rows in the gridview are resized; that's something I want to prevent from happening. Just like Excel, only the row, I'm trying to resize with the pointer, should change its size, instead of having all the rows resized accordingly. I hope I could clarify the situation here.

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Umais,
You can change the GridView's RowHeight by using the GridView's CalcRowHeight event.
Please refer to GridView.CalcRowHeight Event and see this example How to provide the ability to resize rows. I hope it will be helpful to you.

    Show previous comments (3)
    DevExpress Support Team 10 years ago

      Hello,

      In order to better serve and track multiple questions in your inquiry, we have taken the liberty of separating the issues you faced. Please refer to the GridControl - How to change width of a specific row ticket for further correspondence.

        Using the CalcRowHeight event works, but only after the grid is being resized.
        How can I force this event to fire ?
        What I want to do is when the user doubleclicks on a row this row should get a larger rowheight than other rows, so I set a private variable to the rowhandle in the doubleclick and in the CalcRowHeight event I check for this private variable.
        This works but only when the grid resizes.
        So I need to fire this event from the DoubleClick event, how can I do that ?
        I tried GridView1.Invalidate() but that does nothing

        DevExpress Support Team 8 years ago

          Hello,

          I've created a separate ticket on your behalf (T443126: XtraGridControl - How to change the row's height by the mouse double click). It has been placed in our processing queue and will be answered shortly.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.