or
private
void
AddFieldToRadGrid(
string
internalName,
string
type,
string
title)
{
if
(rgStudyInfo.MasterTableView.Columns.FindByUniqueNameSafe(internalName) ==
null
)
{
if
(
string
.IsNullOrEmpty(title)) title = internalName;
GridBoundColumn column =
new
GridBoundColumn();
column.HeaderText = title;
column.AllowSorting =
true
;
column.AllowFiltering =
true
;
column.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
column.DataField = internalName;
column.EmptyDataText =
"N/A"
;
column.UniqueName = internalName;
column.SortExpression = internalName;
column.ItemStyle.VerticalAlign = VerticalAlign.Top;
Type typ;
switch
(type)
{
case
"DateTime"
:
typ =
typeof
(System.DateTime);
break
;
case
"Number"
:
typ =
typeof
(System.Int32);
break
;
case
"Currency"
:
typ =
typeof
(System.Decimal);
break
;
default
:
typ =
typeof
(System.String);
break
;
}
column.DataType = typ;
rgStudyInfo.MasterTableView.Columns.Add(column);
}
}