9 Answers, 1 is accepted
Thank you for writing.
Following the provided information, I was unable to reproduce the issue you are facing. The custom cell element can be accessed as expected. I have attached my sample project. Am I missing something? Could you please specify the exact steps how to reproduce the problem? Thank you in advance.
I am looking forward to your reply.
Regards,
Dess
Progress Telerik

Thank Dess,
I find out my problem. i think i can not get cell element when the hierarchical gridview is collapsed. Right now, when i load the hierarchical gridview like this :
Parent A
Child B (it is collapsed at the loading time)
Child C (it is collapsed at the loading time)
so i can not get cell element child B. Is it right ?
https://www.screencast.com/t/hCxAsQyC // when it is loaded
https://www.screencast.com/t/cwNH9sDNb // when i expand item
Am i right ?
Thank.

And one thing, it looks like i can not get cell element by this in hierarchical gridview:
CustomCell= gvLaborGuide.TableElement.GetCellElement(gridview.Rows[1], gvLaborGuide.Columns["Low"]) as CustomCell;
if (CustomCell!= null)
{
CustomCell.IsVisibile = true;
}

I already tried this : http://www.telerik.com/forums/programmatically-setting-custom-control-cell-values-in-hierarchical-child-rows
When i tried to change value of the gridcolumn . It works. But with custom cell, i can not get value when i do:
row.Cells[5].Value = "test";
protected override void SetContentCore(object value)
{
// value is null
base.SetContentCore(value);
This is the image: https://www.screencast.com/t/6SktH9Uq
Thank you for writing back.
Due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. That is why until you expand the hierarchy, the respective cell elements won't be created.
The RadGridView.TableElement property holds the respective element for the MasterTemplate. It seems that you access a row by the RadGridView.Rows collection from the parent level. If you need to get the custom cell's value for a child cell it is necessary to extract it from the row's ChildRows collection. I have attached a sample project for your reference.
I hope this information helps.
Regards,
Dess
Progress Telerik

Hi Dess,
Thank for your help. In your code:
foreach (var childRow in row.ChildRows)
{
customCell = radGridView1.TableElement.GetCellElement(childRow, this.radGridView1.Columns["Progress column"]) as ProgressBarCellElement;
if (customCell != null)
{
Console.WriteLine("Child "+customCell.Value);
}
}
It never runs. It means the child can not be touched. How can i get the child when it is collapsed and set the value by click the button in your example ?
Thank you for writing back.
Note that due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. Hence, if you have a hierarchy, the cell elements for it will be created when you expand a certain parent row. Otherwise, you won't have cell elements for the hierarchy at all.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik

Hi Dess, I modify your example with checkbox in custom cell. And when i check the checkbox in child . It is not working correctly.
code: https://www.dropbox.com/s/n0soim6e11etj5w/hierarchicalGridView_CheckboxCustomCell.7z?dl=0
https://www.screencast.com/t/IhQ0VCnJ
Please help me . Thank Dess.
Thank you for writing back.
The provided video and sample project are greatly appreciated. Due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. The illustrated problem can be reproduced in a flat grid when you shrink the grid to enable the scrollbars and try scrolling the rows. You can refer to the other thread that you have opened on the same topic where the provided project from 5 Sept shows how to deal with this problem.
I would kindly ask you to use our support ticketing systems in future where you can attach projects and provide any detailed information. Moreover, threads are handled by Telerik support according to license and time of posting.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik