This is a migrated thread and some comments may be shown as answers.

access Custom item to fill data CustomDetailListViewDataCellElement

3 Answers 37 Views
ListView
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 05 Feb 2017, 08:02 AM

Hi

 

I implemented  a (custom item - radListview) in a Listview using CustomDetailListViewDataCellElement

the view type of the parent ListView is Detailview and a data set is bounded to it

I want to fill the custom listview inside the parent listview with data

I can fill it with data at creation time

but after the cell has been created  , I can't

 

I don't know how to reach it

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 06 Feb 2017, 11:58 AM
Hello M,

I am not sure what exactly you want to achieve. Could you please elaborate?

In general, when the control is bound it will reflect the changes automatically. When using custom items you need to use the Syncronize method to update the items. An example is available here: Custom items

I am looking forward to your reply.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
M
Top achievements
Rank 1
answered on 11 Feb 2017, 12:42 PM

Hi again

I wanted to set different items for each customDetailviewdatacell

which are RadListviewElemant s in my case .

However I maged to achive this by the following code in radListView1_CellCreating event :

var lv= e.CellElement.ChildrenHierarchy.FirstOrDefault(c => c.Name == "123");
if (lv is RadListViewElement)
{
((RadListViewElement)cb).Items.Add("item a");
}

 

Or by defining a public property in CustomDetailListViewDataCellElement and access it in Cell_Creating event

for ecample seting datasource of the child Listview

 

Now I'm facing another problem 

I don't know how to synchronize properties for a listview as a CustomDetailListViewDataCellElement  in Synchronize()

so as the result of that  when I scroll verticaly , my child listviews items change 

and I took care of IsCompatible for both custom cells and normal cells

 

Before scrolling :

1st row child listview items --> 1 , 2 , 3

2end row child listview items --> 7 , 8 , 9

and so on

 

After scrolling :

1st row child listview items --> 7 , 8 , 9
2end row child listview items --> 1 , 2 , 3
and so on

 

I will open a new thread for this problem

0
Accepted
Dimitar
Telerik team
answered on 14 Feb 2017, 12:41 PM
Hi M,

This is exactly why I have suggested the Synchronize method. The cell elements are reused and when this is done their content needs to be synchronized. 

We can continue to discuss this in the other thread that you have opened.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListView
Asked by
M
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
M
Top achievements
Rank 1
Share this question
or