I built a grid that has three levels as per the code below and I get this UI:
There should be data under the Card and Other/Basic rows but it doesn't show. I've done this successfully with other grids but something seems to be missing in this case.
The top level data looks like this:
The second level looks like this:
and the 3rd layer data looks like this:
private void SetupGrid(RadGridView grid,
List<ACHElectronicPayments>? achData)
{
grid.MasterTemplate.AutoGenerateColumns = true;
grid.MasterTemplate.ReadOnly = true;
var achTypeData = achData
.GroupBy(p => p.Type)
.Select(group => new
{
Type = group.Key,
AmountCollected = group.Sum(n => n.AmountCollected),
ReturnAmount = group.Sum(n => n.ReturnAmount),
Deposit = group.Sum(n => n.Deposit)
});
GridViewTemplate template2 = new GridViewTemplate();
template2.AutoGenerateColumns = true;
template2.DataSource = achData;
template2.AllowAddNewRow = false;
template2.ReadOnly = true;
template1.Templates.Add(template2);
GridViewRelation relation2 = new GridViewRelation(template1);
relation2.ChildTemplate = template2;
relation2.RelationName = "TypeDCType";
relation2.ParentColumnNames.Add("Type");
//relation2.ParentColumnNames.Add("DCType");
relation2.ChildColumnNames.Add("Type");
//relation2.ChildColumnNames.Add("DCType");
grid.Relations.Add(relation2);
}
grid.DataSource = achTypeData;
grid.MasterTemplate.Columns["Type"].Width = 100;
grid.MasterTemplate.Columns["Type"].HeaderText = "Type";
grid.MasterTemplate.Columns["Type"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
grid.MasterTemplate.Columns["AmountCollected"].Width = 100;
grid.MasterTemplate.Columns["AmountCollected"].HeaderText = "Amount Collected";
grid.MasterTemplate.Columns["AmountCollected"].HeaderTextAlignment = ContentAlignment.MiddleRight;
grid.MasterTemplate.Columns["AmountCollected"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Columns["ReturnAmount"].Width = 80;
grid.MasterTemplate.Columns["ReturnAmount"].HeaderText = "Return Amount";
grid.MasterTemplate.Columns["ReturnAmount"].HeaderTextAlignment = ContentAlignment.MiddleRight;
grid.MasterTemplate.Columns["ReturnAmount"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Columns["Deposit"].Width = 90;
grid.MasterTemplate.Columns["Deposit"].HeaderText = "Deposit";
grid.MasterTemplate.Columns["Deposit"].HeaderTextAlignment = ContentAlignment.MiddleRight;
grid.MasterTemplate.Columns["Deposit"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Templates[0].Columns["Type"].IsVisible = false;
grid.MasterTemplate.Templates[0].Columns["DCType"].Width = 120;
grid.MasterTemplate.Templates[0].Columns["DCType"].HeaderText = string.Empty;
grid.MasterTemplate.Templates[0].Columns["DCType"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
grid.MasterTemplate.Templates[0].Columns["AmountCollected"].Width = 100;
grid.MasterTemplate.Templates[0].Columns["AmountCollected"].HeaderText = string.Empty;
grid.MasterTemplate.Templates[0].Columns["AmountCollected"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Templates[0].Columns["ReturnAmount"].Width = 120;
grid.MasterTemplate.Templates[0].Columns["ReturnAmount"].HeaderText = string.Empty;
grid.MasterTemplate.Templates[0].Columns["ReturnAmount"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Templates[0].Columns["Deposit"].Width = 120;
grid.MasterTemplate.Templates[0].Columns["Deposit"].HeaderText = string.Empty;
grid.MasterTemplate.Templates[0].Columns["Deposit"].FormatString = "{0:#,##0.00}";
//return;
grid.MasterTemplate.Templates[0].Templates[0].Columns["Type"].IsVisible = false;
grid.MasterTemplate.Templates[0].Templates[0].Columns["PaymentType"].Width = 100;
grid.MasterTemplate.Templates[0].Templates[0].Columns["PaymentType"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
grid.MasterTemplate.Templates[0].Templates[0].Columns["EpayGLNumber"].Width = 100;
grid.MasterTemplate.Templates[0].Templates[0].Columns["EpayGLNumber"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
grid.MasterTemplate.Templates[0].Templates[0].Columns["BankAccount"].Width = 100;
grid.MasterTemplate.Templates[0].Templates[0].Columns["BankAccount"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
grid.MasterTemplate.Templates[0].Templates[0].Columns["AmountCollected"].Width = 100;
grid.MasterTemplate.Templates[0].Templates[0].Columns["AmountCollected"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Templates[0].Templates[0].Columns["ReturnAmount"].Width = 120;
grid.MasterTemplate.Templates[0].Templates[0].Columns["ReturnAmount"].Width = 120;
grid.MasterTemplate.Templates[0].Templates[0].Columns["ReturnAmount"].FormatString = "{0:#,##0.00}";
grid.MasterTemplate.Templates[0].Templates[0].Columns["Deposit"].Width = 120;
grid.MasterTemplate.Templates[0].Templates[0].Columns["Deposit"].FormatString = "{0:#,##0.00}";
}What am I missing?
Thanks
Carl

Given the UI below which is bound to BindingLists implementing INotifyChanged interface, I'm seeing some weird behavior.
If I click on on a top row like Account or Active Contract, the items under it check/uncheck correctly. I'm doing this via the gvGrids_CellEndEdit event like this:
private void gvGrids_CellEndEdit(object sender, GridViewCellEventArgs e)
{
string formName = e.Row.Cells["FormDescr"].Value.ToString();
The problem occurs when I click on the checkbox to the left of Form. Doing so fires the HeaderCellToggleStateChanged event:
private void gvGrids_HeaderCellToggleStateChanged(object sender, GridViewHeaderCellEventArgs e)
{
This event will check the Account and Active Contract checkboxes and the ToggleGrids() method will check the Selected property in the underlying BindingList but the subgrid will not refresh unless I scroll down and up again. The weird thing is that If I click the Select All/Deselect All links, which call the same ToggleGrids() method, all works well.
What am I missing here?
Thanks
Carl

Hello,
I’m developing an OOABL application using the Telerik GridView component.
How can I add an image to the top-left corner of the grid header?
And how can I add a context menu when the image is clicked?
Thank you for your feedback.

I'm using the...
AllowRowReorder = True
...setting in a grid and simply need to know if the user drags and drops a row within the same grid. What event do I need to catch to deal with this please....?

I have 2 grids with drag and drop capability, one of them is just a simple grid with 2 columns, the other grid is a grid with 3 Hierarchical Templates that have 3 associated BindingSources.
How can I, when dragging and dropping from the simple grid to the hierarchical grid, determine which Template I am dragging the row to and add it to that Template/BindingSources?
I used exactly the example code you have here (https://docs.telerik.com/devtools/winforms/controls/gridview/rows/drag-and-drop), and indeed everything works.
I just wanted to understand if it's possible to know which Template the row is being dragged to and add it exactly to that Template.
Hi,
I have a requirement to show a column congtaining waiting bar dot rings in a grid view.
I have the currentcode which defines the custom cell and also the custom column
//////////////////////////////////////
// custom cell
//////////////////////////////////////
public class WaitingDotsRingCellElement : GridDataCellElement
{
private RadWaitingBarElement waitingElement;
private DotsRingWaitingBarIndicatorElement ringElement;
public WaitingDotsRingCellElement ( GridViewColumn column, GridRowElement row )
: base ( column, row )
{
}
protected override void CreateChildElements ( )
{
base.CreateChildElements ();
ringElement = new DotsRingWaitingBarIndicatorElement ();
ringElement.DotRadius = 4;
ringElement.LastDotRadius = 1;
ringElement.Radius = 10;
ringElement.ElementCount = 8;
ringElement.NumberOfColors = 4;
ringElement.ElementColor = Color.Red;
waitingElement = new RadWaitingBarElement ();
waitingElement.WaitingIndicators.Clear ();
waitingElement.WaitingSpeed = 40;
waitingElement.WaitingStyle = WaitingBarStyles.DotsRing;
waitingElement.WaitingIndicators.Add (ringElement );
Children.Add ( waitingElement );
}
protected override void SetContentCore ( object value )
{
if ( Value != null && Value != DBNull.Value )
{
if ( Convert.ToInt32 ( Value ) == 0 )
{
waitingElement.StopWaiting ();
}
else if ( Convert.ToInt32 ( Value ) == 1 )
{
waitingElement.StartWaiting ();
}
}
}
public override bool IsCompatible ( GridViewColumn data, object context )
{
return data is WaitingDotsRingColumn && context is GridDataRowElement;
}
protected override Type ThemeEffectiveType
{
get
{
// Ensures the cell inherits grid cell styling
return typeof ( GridDataCellElement );
}
}
} // WaitingDotsRingCellElement
//////////////////////////////////////
// custom column
//////////////////////////////////////
public class WaitingDotsRingColumn : GridViewDataColumn
{
public WaitingDotsRingColumn(string fileName ) : base(fileName)
{
}
public override Type GetCellType ( GridViewRowInfo row )
{
if ( row is GridViewDataRowInfo )
{
return typeof ( WaitingDotsRingCellElement );
}
return base.GetCellType ( row );
}
} // WaitingDotsRingColumnMy issue is that the properties "radius" and "element count" are not being set correctly, however other properties such as element color are being set correctly.
My grid view row height is being set to 32 via gridView.TableElement.RowHeight
In addition, how do i get rid of the "button" effect appearing in the cell background?
Kind regards
Toby


Hi, I have a requirement to have multiple icons in a cell, I have created a custom GridViewDataColumn and a GridDataCellElement
My current implementation has 2 issues, the icons don't appear until you enter or leave a row (in which case only those rows icons get displayed), or when you click on the column (in which case all the visible rows display their icons.
The second issue is that, since I can scroll horizontally, when scrolling right, the cell locations that end up under the location of my icons cells, when you scroll left again, they appear empty, and you need to reload the Datasource or scroll multiple times vertically for them to appear again.
What I'm doing right now is overriding the ArrangeOverride, to locate the icons on the cell with Children[i].Arrange, and creating the icons overriding SetContent and OnCellFormatting and creating LightVisualElements there, calling Children.Clear() at the beginning of the methods.
I'll try to post an example later but has anyone had an issue like this before?

