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 ?
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
}
I already did that. But I need an idea what code to put in that function. I.ve been thinking to calculate grid width minus width of other cells, and to store that value as Subject cell width. But is there any other solution wich is simpler ?