setting margin to ListView?

Hi,

Can any one tell me how to set the left margin for the listview at I need space at left side (before the text).

Thanks in Advance,


Answer this question

setting margin to ListView?

  • Solitaire

    Hi Malleswar,

    In my opinion, we can only implement it with using UserControl. Also, I think it is the easiest way.

    1. Add a UserControl into the project, then drag a ListView control on it.
    2. Dock ListView as right in the UserControl and leave a few empty area at the left hand side.
    3. Adjust the BackColor of UserControl's to window and BorderStyle to FixedSingle.
    4. Adjust the BorderStyle of ListView to None.

    Thus, it looks like what you want.

    Additional, we can also provide Properties in UserControl for accessing the property value of ListView control.

    If you don't think this solution is suitalbe for your project, let's go on further discussion.

    Thanks,

    Zero Dai -MSFT



  • osamaT

    Dear Malleswar,

    Sorry, there's no border style property in ListView control. So, there will be a split line between the empty area and our listview control. We are not able to hide it.

    Zero Dai - MSFT



  • Business Intelligence Analyst

    Hello Malleswar,

    Could you please tell me where the left margin locates

    In a ListViewItem Or just an empty column acts like a space

    Thanks,

    Zero Dai - MSFT



  • leodippolito

    Hi Zero Dai,

    Thank you very much for ur response.

    ur idea is good but I dint find the the border style to listview to make none. I wanted to use panel but it doesnot have any border property.

    Can u please guide me how to come out from this

    Thanks in Advance,

  • smudie

    Hi zero Dai,

    Thank you very much for ur response.

    Actually i just need little empty area at the left hand side. When I use empty column I need use details view. then Header appears. I want little empty area but I dont want to get any header over there.
    I hope u can give me solution.

    Thanks in Advance,


  • setting margin to ListView?