or
string ColumnName = "Price";GroupDescriptor descriptor1 = new GroupDescriptor();descriptor1.GroupNames.Add(ColumnName, ListSortDirection.Ascending); string formatStr = "The total sum of items {0} with price equal to {1} is equal to {2}."; descriptor1.Format = formatStr;descriptor1.Aggregates.Add("Sum('" + ColumnName + "')");this.radGridView1.GroupDescriptors.Add(descriptor1);GroupDescriptor string ColumnName = "Price";GroupDescriptor descriptor1 = new GroupDescriptor();descriptor1.GroupNames.Add(ColumnName, ListSortDirection.Ascending); string formatStr = "The total sum of items {0} with price equal to {1} is equal to {2}."; descriptor1.Format = formatStr;descriptor1.Aggregates.Add("Count('" + ColumnName + "')");this.radGridView1.GroupDescriptors.Add(descriptor1);
Private Sub AddTaskDetailCommand() Dim commandColumn As New GridViewCommandColumn With commandColumn .Name = "ViewTaskDetail" .FieldName = "AssetChecklistID" .HeaderText = String.Empty .Width = 30 .AllowFiltering = False .AllowGroup = False .AllowHide = False .AllowResize = False .AllowSort = False End With RadGridView1.MasterTemplate.Columns.Insert(0, commandColumn) AddHandler RadGridView1.CommandCellClick, AddressOf RadGridView1_CommandCellClick End SubPrivate Sub RadGridView1_CellFormatting(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting If (TypeOf (e.CellElement) Is GridCommandCellElement) Then Dim cmdCell = DirectCast(e.CellElement, GridCommandCellElement) Dim colName = cmdCell.ColumnInfo.Name If colName = "ViewTaskDetail" Then e.CellElement.ToolTipText = "View Task Details..." cmdCell.CommandButton.DisplayStyle = DisplayStyle.Image cmdCell.CommandButton.Image = My.Resources.tag_blue_edit End If End If End Sub

