Lsitview - can we adjust the height of the rows?

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

Firstly, thanks for getting the listview to work! Yah.

I see that the listviewItem has a property to AllowHtml which I assume means you can put some Html fragments in the text.

With that in mind, it would be ideal if we can somehow get the row to size a bit better, even if we have to adjust it in the code.

listView1.Items.Clear();

Here is a quick test of code loading into a listvie

var MyArray = Enum.GetValues(typeof(KnownColor));

foreach(KnownColor oKC in MyArray )

{

ListViewItem oItem = new ListViewItem(“this is a long <br> block of <b>Html</b> text”);

oItem.AllowHtml = true;

oItem.BackColor = System.Drawing.Color.FromKnownColor(oKC);

listView1.Items.Add(oItem);

}

http://screencast.com/t/FNFyTFpZ

Thanks in advance

Mitch

  • You must to post comments
0
0

Hi Mitch,

the bug Luca mentioned in his comment is logged as WJ-7941 and fixed in dev build 1.3.24.

Best regards
Frank

  • You must to post comments
0
0

Hi Mitch,

I have added an enhancement to add a property ListViewItem.RowHeight. Currently you can set the row height of individual rows only with the DataGridView control. But since the ListView control in Details view uses the DataGridView widget it should be no problem to add the RowHeight property.

You can also change the default row height for the ListView in the theme.

We also still have to complete the auto resizing implementation.

Best,

Luca

  • mitch stephens
    RowHeight on the listview will be awesome. We often have rows with different amounts of data. Our application makes extensive use of ListViews – we didn’t trust the DGV on VWG so it will be great if we can keep it that way. I did notice that you have ‘SelectedIndex’ and ‘SelectedItem’ as read-only properties. For VWG migrations, it would be great to have those ReadWrite.. the code workaround become tedious otherwise.
  • mitch stephens
    Luca, I see the RowHeight property on the ListViewItem – that great! However, how would I get the text in the listview cell to wrap? Do you have a best-practices model for this? Would I need to use Html? Thanks Mitch
  • Luca (ITG)
    It should be ListView.LabelWrap but it seems to work only in icon view. Added a bug for this, it should wrap also in details view.
  • mitch stephens
    Latest build works like a charm.. .the text is wrapping in the ListViewItem and the RowHeight can be adjusted. This goes a long way to making WinForm-Style applications look more web-like. Good job!
  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 1, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json