开发者

increasing character limit of subitem in listview with C#

I was wondering if its possible to increase the character limit of listview's subitems text.. there is a limitation 开发者_如何转开发of 259 characters.. any ideas would be appreciated..

regards,


There are some suggestions here. Unfortunately, there is a limit on it which can't be exceeded.

http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/aad539a5-1b9f-4880-8b8e-59d4630706ab

1) You could try sub items to wrap the text. The item limit is 259 characters, so break the objects into multiple items.

2) the only possible solution is to use your own or a third-party component which mimics a ListView but is not derived from it.


This may be able to help you:

.NET ListView, max number of characters, or maximum column width? Possible to override/expand?

Here's the code specifically to help you create your own listview:

public class MyListView : ListView
{
    public MyListView()
    {
        OwnerDraw = true;
        DrawItem += new DrawListViewItemEventHandler(MyListView_DrawItem);
    }

    private void MyListView_DrawItem(object sender, DrawListViewItemEventArgs e)
    {
        e.Graphics.DrawString(e.Item.Text, e.Item.Font, 
                                    new SolidBrush(e.Item.ForeColor), e.Bounds);
    }
}


Just check if objectlistview supports this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜