Skip to content

Truncating ListView Cells

Bill

Asked Mar 24, 2008, 3:16 AM EDT2 answers
Share
LinkedInX
I have a ListView set to details mode, which contains file paths. Is it possible to truncate the cells from the left hand side instead of the right?

For example:
If a cell contains a string (C:\Windows\Some directory\file.txt), then if the column is too small, the cell just reads C:\Windows\So...

I need it to truncate from the other side, so it reads ...ctory\file.txt. Is this possible?

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    try this peace of code:

    string x = @"C:\Windows\So" + Environment.NewLine + @"ctory\file.txt";
    MessageBox.Show(x);
    0
  • 0
    That's not really what I'm looking for. The text was just an example. The text would have to truncate depending on how much space was available in the cell.
    0