0

Well I am having a very specific requirement in my current project. I need to add path values (as string) in a DataGridView. So the cell must show the path in format PathEllipsis i.e. similar to this -

d:\abcd\efgh\ijkl\mnop\qrst...\test.txt\0F\GHIJ\KLMN\OPQR\STIV\WXYZ\test.txt.

I don't know if I am searching it correctly, but I am unable to find relevant information. Any Idea?

One workaround that I know is to manually edit the path, but for that, I'll have to keep a hidden column or Tag. The process will be tedious and I don't want that...

Help!!!

Later Edited - Yes, the beginning and the end of the path must suit to the length of the cell if path length is wider than the cell.

VarunPandey
  • 327
  • 1
  • 12
  • Does this help you.... http://stackoverflow.com/questions/2529436/c-sharp-path-ellipsis-without-win32-api-call – Arif Eqbal Jul 20 '12 at 10:48
  • Help build up the community, mark answers/upvote which you found useful, Also have a look at this http://stackoverflow.com/questions/20467/path-display-in-label – V4Vendetta Jul 20 '12 at 10:51
  • Do you mean that the beginning and the end of the path will suit to the length of the cell if path legth is wider then the cell (in this case "..." (dots) will be used in the middle?! – Mitja Bonca Jul 20 '12 at 10:54

1 Answers1

0

Here i am posting the solution that i used for my project. <textbox> for dynamic data and tag for static data

<asp:TemplateField HeaderText="Path Details" ShowHeader="False">
    <ItemTemplate>
        <a href="D:\FolderName\YourFileName.txt">D:\FolderName\YourFileName.txt</a>
        <asp:TextBox ID="txtpath" TextMode="MultiLine" runat="server" ReadOnly="true" Text='<%# (string)Eval("Database Field") %>'></asp:TextBox>                                                                                                
    </ItemTemplate>
</asp:TemplateField>
Sanket R. Patil
  • 311
  • 1
  • 2
  • 8