| <telerik:GridButtonColumn ConfirmText="ELIMINARE l'elemento Selezionato?" |
| ButtonType="ImageButton" |
| ImageUrl="~/admin/images/Delete.gif" |
| CommandName="Delete" Text="Elimina Elemento" |
| UniqueName="DeleteColumn"> |
| <ItemStyle HorizontalAlign="Center" /> |
| <HeaderStyle Width="30px" /> |
| </telerik:GridButtonColumn> |
| public class TaskView |
| { |
| #region Private Variables |
| private string _projectName; |
| private string _projectCode; |
| private string _taskCode; |
| private string _taskName; |
| private List<string> _dataTypeHeaderNameList; |
| private List<string> _dataTypeNameList; |
| private List<decimal> _dataTypeDataList; |
| #endregion |
| #region Constructors |
| // Constructors |
| public TaskView() |
| { |
| } |
| #endregion |
| #region Properties |
| public string ProjectCode |
| { |
| get { return _projectCode; } |
| set { _projectCode = value; } |
| } |
| public string ProjectName |
| { |
| get { return _projectName; } |
| set { _projectName = value; } |
| } |
| public string TaskCode |
| { |
| get { return _taskCode; } |
| set { _taskCode = value; } |
| } |
| public string TaskName |
| { |
| get { return _taskName; } |
| set { _taskName = value; } |
| } |
| public List<string> DataTypeHeaderNameList |
| { |
| get { return _dataTypeHeaderNameList; } |
| set { _dataTypeHeaderNameList = value; } |
| } |
| public List<string> DataTypeNameList |
| { |
| get { return _dataTypeNameList; } |
| set { _dataTypeNameList = value; } |
| } |
| public List<decimal> DataTypeDataList |
| { |
| get { return _dataTypeDataList; } |
| set { _dataTypeDataList = value; } |
| } |
| #endregion |
| } |
| boundColumn = new GridBoundColumn(); |
| RadGridTaskView.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.UniqueName = "ProjectName"; |
| boundColumn.DataField = "ProjectName"; |
| boundColumn.HeaderText = "Project Name"; |
| boundColumn.Aggregate = GridAggregateFunction.None; |
| boundColumn = new GridBoundColumn(); |
| RadGridTaskView.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.UniqueName = "TaskName"; |
| boundColumn.DataField = "TaskName"; |
| boundColumn.HeaderText = "Task"; |
| boundColumn.Aggregate = GridAggregateFunction.None; |
| for (int i = 0; i < criteria.CostDataList.Count; i++) |
| { |
| boundColumn = new GridBoundColumn(); |
| RadGridTaskView.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.UniqueName = criteria.CostDataList[i]; |
| boundColumn.DataField = "DataTypeDataList[" + i.ToString() + "]"; |
| boundColumn.HeaderText = criteria.CostDataList[i]; |
| boundColumn.DataFormatString = "{0:#,###.00}"; |
| boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Right; |
| boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right; |
| boundColumn.DataType = Type.GetType("System.Decimal", false); |
| boundColumn.Aggregate = GridAggregateFunction.Sum; |
| boundColumn.FooterText = "Total:"; |
| } |
| System.Data.SyntaxErrorException was unhandled by user code |
| Message="Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier." |
| Source="System.Data" |
| StackTrace: |
| at System.Data.ExpressionParser.ParseAggregateArgument(FunctionId aggregate) |
| at System.Data.ExpressionParser.Parse() |
| at System.Data.DataExpression..ctor(DataTable table, String expression, Type type) |
| at System.Data.DataTable.Compute(String expression, String filter) |
| at Telerik.Web.UI.GridBoundColumn.ApplyAggregates(TableCell cell, String footerText) |
| at Telerik.Web.UI.GridBoundColumn.cell_DataBinding(Object sender, EventArgs e) |
| at System.Web.UI.Control.OnDataBinding(EventArgs e) |
| at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) |
| at System.Web.UI.Control.DataBind() |
| at System.Web.UI.Control.DataBindChildren() |
| at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) |
| at System.Web.UI.Control.DataBind() |
| at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) |
| at Telerik.Web.UI.GridTableView.CreateFooterItem(Boolean useDataSource, GridColumn[] copiedColumnSet, GridTFoot tfoot) |
| at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) |
| at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) |
| at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) |
| at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) |
| at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) |
| at System.Web.UI.WebControls.DataBoundControl.PerformSelect() |
| at Telerik.Web.UI.GridTableView.PerformSelect() |
| at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() |
| at Telerik.Web.UI.GridTableView.DataBind() |
| at Telerik.Web.UI.RadGrid.DataBind() |
| at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) |
| at Telerik.Web.UI.RadGrid.Rebind() |
| at View_TaskView.HierarchyDataViewCriteria_Submit(Object sender, EventArgs e) in d:\Documents and Settings\TLP\My Documents\Visual Studio 2005\Projects\Athena\AthenaWeb\View\TaskView.aspx.cs:line 366 |
| at UserControls_DataViewCriteria.OnSubmit(EventArgs e) in d:\Documents and Settings\TLP\My Documents\Visual Studio 2005\Projects\Athena\AthenaWeb\UserControls\DataViewCriteria.ascx.cs:line 68 |
| at UserControls_DataViewCriteria.ButtonSubmit_Click(Object sender, EventArgs e) in d:\Documents and Settings\TLP\My Documents\Visual Studio 2005\Projects\Athena\AthenaWeb\UserControls\DataViewCriteria.ascx.cs:line 352 |
| at System.Web.UI.WebControls.Button.OnClick(EventArgs e) |
| at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) |
| at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) |
| at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) |
| at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) |
| at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
Hi,
The ItemCommand on my RadGrid is not firing. I tried using grid from
Telerik.WebControls as well as Telerik.Web.UI.
Here is my sample page.
Please help
Thanks
Viji
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<br />
<radG:RadGrid ID="RadGrid1" runat="server" EnableAJAX="True" GridLines="None" OnItemCommand="RadGrid1_ItemCommand"
OnNeedDataSource="RadGrid1_NeedDataSource" Style="z-index: 100; left: 9px; position: absolute;top: 71px">
<ExportSettings>
<Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"
PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />
</ExportSettings>
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView>
<RowIndicatorColumn Visible="False">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn Resizable="False" Visible="False">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
</MasterTableView>
</radG:RadGrid>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/PatientTest.xml">
</asp:XmlDataSource>
</form>
</
body>
</
html>