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
1080
Auto resize two columns
posted

Hello,

I am making e-mail client, and trying to look lile MS Outlook. I created grid just like this

[Image] [FromEmail]                              [Date]   [FlagIcon]
               [Subject]                   [AttachmentIcon]

It's working great, but now I want to auto resize only columns FromEmail and Subject ? If I use autoresize, it resizes all columns. What's the best way to resize only these two columns, and Image column to stay at left side, and Data, Flag, Attachment on right ?

Parents
  • 280
    Suggested Answer
    posted

    1. Set the UltraWinGrid.DisplayLayout.AutoFitStyle to None

    2. Add an event handler to the InitializeLayout event of the UltraWinGrid

    3. In the event handler function access the columns you're interested in using the InitializeLayoutEventArgs object parameter passed to the function:

     

    private

     

     

    void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e){

    ColumnsCollection cols = e.Layout.Bands[0].Columns

    cols["your_column"].Width = 255

    // ... do whatever else you need to do here

     

    }

     

    }

    }

     

Reply Children