vb.net - How can I make custom DataGridViewColumn properties work at design time? -
vb.net - How can I make custom DataGridViewColumn properties work at design time? -
recently i've written custom datagridviewcolumn host progress bar. column class has property i'd propagate cells of column. utilize code implement it:-
<defaultvalue(5i)> _ public property blockwidth() integer homecoming _blockwidth end set(byval value integer) _blockwidth = value me.columncells.foreach(sub(cell) cell.blockwidth = value) end set end property
and this:-
private readonly property columncells ienumerable(of datagridviewprogressbarcell) if me.datagridview isnot nil homecoming me.datagridview.rows. cast(of datagridviewrow). where(function(r) typeof r.cells.item(me.index) datagridviewprogressbarcell). select(function(r) directcast(r.cells.item(me.index), datagridviewprogressbarcell)) else homecoming new datagridviewprogressbarcell() {} end if end end property
now works @ runtime. if alter blockwidth property of column @ runtime, cells of column alter reflect property alter cannot seem work @ design time. @ design time cell doesn't change, property alter persists cell doesn't change. i've tried manner of trickery , refuses work. please can tell me i'm doing wrong ?
try utlizing _cellformatting sub under datagridview. can programmatically set want display show.
see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting(v=vs.110).aspx
datagridview customization , formatting
hope helps!
vb.net properties datagridviewcolumn
Comments
Post a Comment