In my WP8 app i have a longlistselector which includes CheckBox in its itemtemplate.
I want to set the IsChecked property of each checkbox in my list at run-time.
For doing this i figured i would need to loop through the items in the list and get access to the checkbox instance in each item and set its property.
But i cant find a way to get reference to a list item at a particular index in the longlistselector.
Can someone please guide me with this?? i am pretty new to this platfom.
Thanks!
Related
I am using this Plunkr. It displays a list of products. When I click on remove button, the items which are checked should be removed from the list.
<button ng-click="onClick()" class="k-button">Remove</button>
I have tried various things however, nothing is working. I am not exactly getting what logic should go in the following logic
$scope.onClick = function () {
}
I know it is something very simple however, I am not able to get it. Any help would be appreciated.
If you ask about logic, i will try to explain it here..
First inside onClick function get your gird's datasource variable, then find all selected checkboxes and use jquery each to iterate over each checkbox and find closest data-uid attribute. Every grid row has uid in its DOM, with this uid value get kendo observable object from datasource with getByUid method.
Last using datasource pass this observable object to remove method of datasource.
This is Kendo datasource API, hopes it helps you to write the code..
I am having trouble getting code to fire when a listview has items reordered. I created an event handler for collectionchanged, but that fires when an item is added. I want it only to fire when it is reordered, but reordered in Winrt is a combination of remove and add.
The more general idea of what I want to do is create two listviews of items, where the first listview's items rearrange if corresponding items in the second listview are reordered by the user using drag and drop. I'm pretty close to getting it to work. I have id numbers for elements in both lists.
First, make sure you are using an observable collection.
Second, read this: XAML/C#: What event fires after reordering a gridview?
Best of luck!
In my Windows Phone 8 application I am using a LongListSelector to display grouped data. I would like to bind the background color of the item in the ItemTemplate to the SelectedItem using a value converter.
However, I cannot figure out how to access the selected item in the value converter to return the correct background color. What is the correct way to setup the coloring of the selected item in a LongListSelector?
I prefer to convert value in code end pass the converted value to XAML.
You can access selected item data object by yourLongListSelector.SelectedItem.DataContext
i have a data grid which is having two renderers. one is text box and other is dropdwon. both are mxml rendered.
My requiremnet is when user edit the textbox value in a particular row i should make the dropdown value also changed of that particular row.
Could someone help me on this.
thanks
If this is spark:
The ItemRenderer has a property owner which is the dataGrid - you'll want to add an eventlistener on this (from the combobox one) - presumably coming from the other renderer which you dispatch from the owner point of view (eg: in textboxitemeditor: owner.dispatchEvent(RendererEvent.CHANGE, value))
In this listener - when the appropriate data was edited, you can update your combo box appropriately.
The key when doing something like this, is to remember to remove the listener and any other references you create in the dispose() method.
If this is halo:
It's essentially almost the same as above, the difference is there is a baseListData object which has the owner reference from the renderer.
i have an array list of data which i am showing in spark data grid.
once i select an idem and click on a button that i have linked with datagrid it adds a panel on screen. I want to disable this selection i-e to tell that this item panel have already been added. Any ideas how can i do that?
best Regards
Try this.contains(child:DisplayObject) It Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren, great-grandchildren, and so on each return true.
I think there's a .disable() function on datagrids, or you can use return false; so that it won't proceed.