I have a master "gridview" and a detail "gridview" connected to it. The detail "gridview" does not have any columns initially, it loads data from database and it creates its columns.
For example, i'm trying to handle cellvaluechanged event, however, even if i write something in a cell of the gridview and then pressing enter, the event is not firing. What can the reason be?
In my opinion the best way to handle this is: Create a class which represent the data from your database. Let the class implement the interface INotifyPropertyChanged. Then create a BindingList with all Objects from your Database. Now use this BindingList as DataSource for your Grid. The BindingList got the Event ListChanged. This will recognize that a Property Value in your DataSource is changed if you type some new value in cell.
I think this is best practice because you are working with your DataSource and not with GridView directly.
Otherwise the event should fire for sure. If you cant use my idea send some code, maybe i can find the problem then.
regards
Related
I've been trying to make sense the following article explaining how to use Realm in Xamarin:
https://blog.xamarin.com/cross-platform-development-with-xamarin-forms-and-realm/.
Realm seems to integrate nicely with the xaml UI for simple objects, but how does this translate to more complex objects that have children?
When showing the add/edit page for an object, I need to show a list with all the object's children. I want to be able to show the add/edit page for those children when tapped in the list. The problem is that there is already a transaction open in the first add/edit page and I can't open a second one.
The only option I see so far is to not use transactions and to bind fields to separate member variables then copy those values in a Realm object and save it. But then I don't see the real advantage in using Realm.
Thank you!
I am using Monotouch dialog with Mvvmcross. My requirement is to have multiple textfield in single element/cell. But in Entryelement we have only one value property which has by default two way binding. Rest of the property are with only one way binding.
I have also tried with UIViewElement but same thing I can bind only one way. UI will update based on changes of ViewModel. But if something user will enter into textfield then how to fire ValueChange for it is challenge for me.
It would be good if somebody can point out rough steps to achieve it.
I have a class Seive that implements INotifyPropertyChanged. I have a ObservableCollection SeiveList.I input details of required Seive and dispaly those Seives in the dataGrid. SeiveList is the DataContext of my dataGrid.
On each Seive added/updated, I got to perform certian calculations and display them. In Datarid, I can't find any event for row added or updated. I found SourceChanged event, but also is fired just once when the DataContext is set I guess, otherwise while the Seives are added/updated in SeiveList nothing is fired.
Which event do I handle that will help me know if any row is added or updated, so I can perform the calculations and display the results on each change ? I came to know about CollectionChanged event of ObservableCollection, but also found that it doesn't work. More over, I don't have any class that implements ObservableCollection. How do I end up doing this ???
Any help is highly appreciated. Kindly try to help em at the earliest. Am stuck up with this.
Thanks.
I got the solution : I implemented CollectionChanged event of my ObservableCollection object, added the calculation to be done in it without pushing back the object that I changed yet the collection obj was changed. And this are workign perfectly fine.
Thanks
This is my first time building a UI in Access (using Access 2007), and I'm wondering what is the Right Way (TM) of going about this.
Essentially, I have several different queries that I'd like to display as pivot charts, pivot tables, tables, and reports. Eventually I'm also going to have to build forms to manipulate the data as well, but the application's primary function is to display data.
I'm thinking of having a button for each different display down the left side of the main window, and having the rest of the window display each button's corresponding contents (e.g. a pivot chart).
I have an idea that this can be accomplished using a single subform in the main form, and setting the subform's Source Object property within a function such as this one:
Public Function SetSubformSourceObject(newSourceObject) As Variant
subform.SourceObject = newSourceObject
End Function
Then, for each button I'd set its OnClick property to call this function with the name of the query I'd like to run.
Now, I have no idea if this is the best way of going about things, and would really appreciate some input :)
The principle seems fair to me. You have to give it a try. You do not even need a form-subform structure. You can set your sourceObject at the form level, and have your buttons in a commandBar instead of having them as controls on the form, so you do not have any 'form specific' code (like "onCLick") and controls. action/command controls on a form are space, code and maintenance consuming, while commandbars are more generic and are THE object that can hold all your action controls.
I haven't been able to successfully bind some test data to a SketchFlow ComboBox. I added a sample data source and created a collection with some basic string values. There are a number of tutorials on how to bind to a ListBox in SketchFlow and that works fine, just not finding anything for a ComboBox.
One thing that caught me out a few times is that you need to have your data in "list mode" before you drag it on to the control (combo box or list box).
It seems to work as I expected, so perhaps I'm not understanding your issue correctly, but I'll give it a shot! I created a sample DataSource with a couple of strings in it, added a ComboBox to the layout root and then just dragged the Collection from the DataSource and dropped it on the ComboBox.
Keep in mind that if you drag the DataSource itself, you'll only be setting the DataContext property of the ComboBox and that's not enough to get your items to display. You also need the ItemsSource bound to the Collection of the DataSource and an ItemTemplate or a DisplayMemberPath to tell the ComboBox how to display your items.
Additionally, if you use the drag and drop method of binding, it will use the ItemTemplate approach for you, which may or may not be what you want as it will generally create a StackPanel and display all fields from the row in your Collection per item in the ComboBox. You can remove the ItemTemplate and set DisplayMemberPath to whichever field you wish to have displayed from your data source's collection.