Hello,
I have followed the tutorials and I was able to add a CustomCell made of a RadColorBox, this is working perfectly fine as long as the number of columns in the ListBox does not cause the horizontal scroll bar to appear. When this happens, and the user scrolls to show the other columns, the RadColorBox disappears initially and, by debugging what's happening, I see that it's "changing" the cell looping between all the columns in the rows.
This is the starting state
This is what happens when I scroll right untill the first column goes out of view then back in starting position
This is what happens if i keep scrolling left and right, the ColorBox is in the last column
If I keep scrolling left and right
Please note that this "scrolling" ColorBox is possible only because I have commented a line in the custom control
public override bool IsCompatible(ListViewDetailColumn data, object context)
{
//if (data.Name != "Colore")
//{
// return false;
//}
return base.IsCompatible(data, context);
}
If I uncomment the name check, the ColorBox disappears until I have scrolled left and right enough times to allow it to go back to the first column, by debugging the data.Name value I see that it's "moving" from one column to another
This is the Creating event and I am adding the custom cell only if the cell is "Colore", exactly like in the examples, can anyone help me fix this strange behaviour?
private void listEventi_CellCreating(object sender, Telerik.WinControls.UI.ListViewCellElementCreatingEventArgs e)
{
DetailListViewDataCellElement cell = e.CellElement as DetailListViewDataCellElement;
if (cell != null && cell.Data.Name == "Colore")
{
var newCell = new CustomDetailListViewDataCellElement(cell.RowElement, e.CellElement.Data);
newCell.FormParent = this;
e.CellElement = newCell;
}
}
Thank you in advance for any suggestion