or
GridViewSummaryRowItem totals = new GridViewSummaryRowItem();
totals.Add(
new GridViewSummaryItem("Total", "{0}", GridAggregateFunction.Sum));
this.radGridView1.MasterGridViewTemplate.SummaryRowsBottom.Add(totals);
Am i missing something? Are there more properties i need to be setting on the grid or column or master view for the summary row to show ?
Thanks
Anisha
private void gvPremios_CellFormatting(object sender, CellFormattingEventArgs e) |
{ |
if (e.CellElement.ColumnInfo is GridViewDataColumn && !(e.CellElement.RowElement is GridTableHeaderRowElement)) |
{ |
GridViewDataColumn column = (GridViewDataColumn)e.CellElement.ColumnInfo; |
if (column.DataField == "MyColumn") |
{ |
if (e.CellElement.Children.Count > 0) |
return; |
RadLabelElement element = new RadLabelElement(); |
element.Text = "<html>This is a test..." |
e.CellElement.Children.Add(element); |
} |
} |
GridViewTextBoxColumn lengthColumn = new GridViewTextBoxColumn(); | |
lengthColumn.UniqueName = "LengthColumn"; | |
lengthColumn.HeaderText = "Length"; | |
lengthColumn.DataType = typeof(Int32); | |
lengthColumn.FieldName = "itemLength"; | |
lengthColumn.FormatString = "{0}cm"; | |
this.gvwManifestLines.Columns.Insert(i++, lengthColumn); | |
GridViewTextBoxColumn widthColumn = new GridViewTextBoxColumn(); | |
widthColumn.UniqueName = "WidthColumn"; | |
widthColumn.HeaderText = "Width"; | |
widthColumn.DataType = typeof(Int32); | |
widthColumn.FieldName = "itemWidth"; | |
widthColumn.FormatString = "{0}cm"; | |
this.gvwManifestLines.Columns.Insert(i++, widthColumn); | |
GridViewTextBoxColumn heightColumn = new GridViewTextBoxColumn(); | |
heightColumn.UniqueName = "HeightColumn"; | |
heightColumn.HeaderText = "Height"; | |
heightColumn.DataType = typeof(Int32); | |
heightColumn.FieldName = "itemHeight"; | |
heightColumn.FormatString = "{0}cm"; | |
this.gvwManifestLines.Columns.Insert(i++, heightColumn); |
private void gvwManifestLines_CellFormatting(object sender, CellFormattingEventArgs e) | |
{ | |
GridViewCellInfo cellInfo = this.gvwManifestLines.Rows[e.CellElement.RowIndex].Cells[e.CellElement.ColumnIndex]; | |
if (e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["LengthColumn"].Index || | |
e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["WidthColumn"].Index || | |
e.CellElement.ColumnIndex == this.gvwManifestLines.Columns["HeightColumn"].Index) | |
{ | |
if (cellInfo.Value == null || | |
cellInfo.Value is DBNull || | |
(int)cellInfo.Value <= 0) | |
{ | |
e.CellElement.FormatString = "n/a"; | |
} | |
} | |
} |
SchedulerMonthViewElement monthView = this.schRates.SchedulerElement.ViewElement as SchedulerMonthViewElement; |
Telerik.WinControls.RadElementCollection childrenCollection = monthView.Children[1].Children; |
DateTime startDate = DateTime.MinValue; |
DateTime endDate = DateTime.MinValue; |
foreach (MonthCellElement cell in childrenCollection) |
{ |
if (cell.Header.Selected == true) |
{ |
if (startDate == DateTime.MinValue) |
{ |
startDate = cell.Date; |
} |
else |
{ |
endDate = cell.Date; |
} |
} |
if (childrenCollection.IndexOf(cell) == 34) |
{ break; } |
} |