c# - Accessing the actual value of a RadGrid DataItem rather than its text -


i have radgrid autogenerate columns set true.

my datasource looks following:

datatable dt = new datatable(); dt.columns.add("column1", typeof (double)); dt.columns.add("column2", typeof (double)); dt.columns.add("column3", typeof (double));  dt.rows.add(0.05547, 0.03432, 0.03444); dt.rows.add(0.54612, 0.77764, 0.86763); dt.rows.add(0.65711, 0.88735, 0.67864); 

in grids itemdatabound event formatting values percents this:

double number; if (double.tryparse(item[col.uniquename].text, out number)) {      item[col.uniquename].text = string.format("{0:p2}", number);                             } 

now lets want loop through grid dataitems somewhere else in code , original values, not formatted percent values. best way this?

foreach (griddataitem item in radgrid1.items)  {      // returning value 5 %, need 0.05547      item["column1"].text; } 

since formatting text in itemdatabound, cannot original value somewhere else in code. itemdatabound behaviour, each time when postback itemdatabound executed, (even changing page size in radgrid).

but can it, creating new datatable , filling details parallely in itemdatabound. can data datatable throughout code.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -