简体   繁体   中英

RadGrid column - Get nonrounded value

I have column, where I bind values like 1234.567 and I display them like 1235. But in code behind, I want real value (1234.567)

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
cmd.Parameters.Add("@p7", SqlDbType.Float).Value = item("column7").Text

Problem is, I get rounded value here. How to get 1234.567?

Since you are displaying by formatting it to a whole numbers, you won't be able to retrieve it from the grid that way in the code behind.

To work around this issue:

  1. Add another column to the Radgrid (with the non-rounded number)
  2. Set the Display = False on that column

Then use that new column in the code-behind.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM