sql - Combining two values from different columns into one column in Datagridwiev -


i using ms sql server , visual basic.

i want combine calculated column , column add units calculation. (for example "200 m2")

dgwnewlayout.columns(5).defaultcellstyle.format = "0.00 " & "'" & dgwnewlayout.currentrow.cells(9).value & "'" 

this code first entered unit? how can each column?

you use cellformatting event.

private withevents dgwnewlayout datagridview  private sub dgwnewlayout_cellformatting(sender object,     e datagridviewcellformattingeventargs ) handles dgwnewlayout.cellformatting      if e.columnindex = 5         e.value = cdbl(e.value).tostring("0.00") &             " " & cstr(dgwnewlayout.rows(e.rowindex).cells(9).value)         e.formattingapplied = true     end if end sub 

as dom sinclair says, have poor performance.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -