For some reason, Gridlines is not supported by CF control, although the core set of ListView does. P / Call for help.
private const uint LVM_FIRST = 0x1000; private const uint LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54; private const uint LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55; private const uint LVS_EX_GRIDLINES = 0x00000001; [DllImport("coredll.dll")] private static extern uint SendMessage(IntPtr hwnd, uint msg, uint wparam, uint lparam); public void EnableGridlines(ListView listView) { var style = SendMessage( listView.Handle, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); style |= LVS_EX_GRIDLINES; var style = SendMessage( listView.Handle, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, style); }
source share