Hello,
I create a gridboundcolumn from codebehind and try to group it.
It throws an exception:
I create the column like this:
when i define the columns in the markup like this it works:
I create a gridboundcolumn from codebehind and try to group it.
It throws an exception:
Unhandled exception at line 885, column 13 in http://server1/ScriptResource.axd?d=1A_JfTzkVI_BPK0wyueglza3uf3p5EQOp4lCh3bkZFj2kwIlPrGfNBqAYyJG42yrzLhNfZTtBWoYuqokkf-vNOdy8LQfqHEEJse-2Zpg5nGn_znQ0ma5rdc2XuV8eHZvGcbaSsZ0Wu1n7TPfMrcwAYGxAJyYoPMx7lFZ_2kSkbfeRFZ1GXIexwskAgJ3NeM67J1V_H9-C5a9cYJV09SQKA2&t=6119e399
0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Expression cannot be null or empty
Whats the correct way to create a column from codebehind?
Marcel de Groot
-----------
I create the column like this:
GridBoundColumn col =
new
GridBoundColumn();
col.UniqueName = field.UniqueName;
col.HeaderText = field.Caption;
col.DataField = field.UniqueName;
// col.GroupByExpression =field.UniqueName + " Group by "+ field.UniqueName;
col.SortExpression = field.UniqueName;
col.HeaderButtonType = GridHeaderButtonType.TextButton;
RadGrid1.Columns.Add(col);
when i define the columns in the markup like this it works:
<
MasterTableView
Width
=
"100%"
>
<
GroupByExpressions
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"Key"
HeaderText
=
"Key"
HeaderButtonType
=
"TextButton"
DataField
=
"Key"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>