Dynamic rowheight of NlistView...is it possible?


Author
Message
jody cummings
jody cummings
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1

I have been trying to figure out a way to make the height of the NlistView dynamic.  the data going into the NListView is dynamic.

Is this possible or am i out of luck?

Jody

 

p.s. your controls are awesome.


Reply
Angel Chorbadzhiev
Angel Chorbadzhiev
Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)
Group: Forum Members
Posts: 139, Visits: 184

Hi Jody,

In this case you will need to setup the Size property of the NListView control.

The value of the height should be the height of the items multiply to the number of the items plus one, and also you will need to add the height of the header.

The above apply if the control is in Details view, because otherwise the items may resizes in multiple columns.

Here is the code sample:

Rectangle r = nListView1.Items[0].Bounds;

int items = r.Height * (nListView1.Items.Count + 1);

Size size = new Size(nListView1.Width, items + nListView1.HeaderHeight);

nListView1.Size = size;

 

Regards,

Angel.

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search