Hi,
I have a RadGrid setup which displays info from a table. In one specific column I need to get additional information using a static function and display it next to the cell value. I tried using the <%# %> but it just complained that it doesn't allow it. Is there a way to call a static function in the namespace, add the databound parameter as an input parameter and get the result? Here is the code I tried:
The DBManager getRelated tasks is as follows:
This is the error I get:
Any suggestions?
Miklos
I have a RadGrid setup which displays info from a table. In one specific column I need to get additional information using a static function and display it next to the cell value. I tried using the <%# %> but it just complained that it doesn't allow it. Is there a way to call a static function in the namespace, add the databound parameter as an input parameter and get the result? Here is the code I tried:
| <telerik:GridBoundColumn DataField="uwr_id" DataType="System.Int64" | |
| HeaderText="Request ID" | |
| ReadOnly="True" | |
| SortExpression="uwr_id" | |
| UniqueName="uwr_id" | |
| DataFormatString="<%# Base.DBManager.getRelatedTasks(DataBinder.Eval(Container.DataItem,"uwr_id")) %>" > | |
| </telerik:GridBoundColumn> |
The DBManager getRelated tasks is as follows:
| public static string getRelatedTasks(object obj) |
| { |
| long uwr_id = (long)obj; |
| string res = "SIMPLE RES "; //no processing, just for testing |
| return res; |
| } |
This is the error I get:
| Server Error in '/' Application. |
| Parser Error |
| Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. |
| Parser Error Message: Literal content ('<telerik:GridBoundColumn DataField="uwr_id" DataType="System.Int64" |
| HeaderText="Request ID" ReadOnly="True" SortExpression="uwr_id" UniqueName="uwr_id" |
| DataFormatString="') is not allowed within a 'Telerik.Web.UI.GridColumnCollection'. |
| Source Error: |
| Line 23: </ExpandCollapseColumn> |
| Line 24: <Columns> |
| Line 25: <telerik:GridBoundColumn DataField="uwr_id" DataType="System.Int64" |
| Line 26: HeaderText="Request ID" ReadOnly="True" SortExpression="uwr_id" UniqueName="uwr_id" |
| Line 27: DataFormatString="<%# Base.DBManager.getRelatedTasks(DataBinder.Eval(Container.DataItem,"uwr_id")) %>" > |
| Source File: /admin/AdmWebsiteRequests.aspx Line: 25 |
| Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434 |
Any suggestions?
Miklos
