It seems, that Janusys isn't active anymore. The Forum Posts get not answered since a while. In my application (Winforms!), I use there controls since a couple of years. Now I want to extend my application with the schedular Control.
I found a Sample within the Janus Software, where they "explain", how the Control can be used, in DataBound mode.
The Problem there is, that this example works with DataSet / TableAdapter.
This I don't want to use, because I use in my whole application LinQ.
Now, I tried to move on, with there sample application and rewrite it, so I can use LinQ. But I am not able to get it working.
I use BindingSource to bind my data via LinQ from the database to the Control. This works really fine and all saved Appointments get displayed as expected.
But...
I am not getting it working, to create/update Appointments.
1) The BindingSource AddNew Handler is fired, but with "NewObject" is Nothing
2) I don't know, how I get an existing Appointment verified, that this one is already saved in database, or if it is a new Appointment.
Does anyone could help me with this Problem and can explain, how I can do it Right, without using DataSet/TableAdapter?
THX a lot in Advance
THX a lot for everyone, who looked into it.
I found a solution, which looks to work fine.
I have to add all appointments with a ForEach Loop and remove the BindingSource completly.
Then I can add the Key Value, and from there, it is easy, because, I am able to see, if this is already an existing appointment (then the key has a value) or even not.
THX - Have a nice evenenig
Related
Has anyone heard of the following issue?
I created an array of DataGridView and I am successfully filling them with information (verified in a data dump).
However when I try to display the DataGridViews, even when I made sure size, location and visibility were all set, the DataGridView table wasn’t show up in my form1.
When I use the DataGridView normally (created and compiled) it works.
Those were the settings I used to set the run-time creations of the array of DataGridViews.
If you really need to see my code I can post it.
I am just looking for ideas of where I haven’t figured out to look yet.
I like to figure stuff out on my own as much as possible but I’ve been stuck for a couple days now.
I’m guessing it’s because of the array and not because I created the dgv at runtime. Anyone have any ideas?
Thanks T.Schwarz. That worked as I wanted!
I apologize to all for not posting code. As I stated I like to figure out things and I wasn’t looking to get others to do my code for me. I guess everyone needs to see what I was doing to understand why I was having a problem. My second post will be much more informative. Thanks for the help everyone!
I don't think I need to post any code but if I need to I will.
I have created a Windows Form in Visual Studio that creates a record and saves it into a database. I have also added an update function so that I can change the record and save the new changes.
What I need to know though is how to create some kind of version history. i.e. When I click update, I want it to save the previous version so that I can look back at it. Like a bug tracker has a kind of version control but a lot simpler (hopefully).
Would I need a separate database? Could I have another datagridview that when a record is clicked on (or a button) it will show the history of changes for that record?
I've done many searches online and just can't find how to do it or where to look exactly to find this?
Any help would be greatly appreciated.
Thanks
you are talking about audit trail , take look at this :Link
I know this example for MVC but it's the same idea
you only need one table to track changes of the whole database by using json objects that represent "before" and "after"
This article here describes handling concurrency exceptions. The steps to reproduce the problem are:
Create a new Windows Application project.
Create a new dataset based on the Northwind Customers table.
Create a form with a DataGridView to display the data.
Fill a dataset with data from the Customers table in the Northwind database.
After filling the dataset, use the Visual Database Tools in Visual Studio to directly access the Customers data table and change a record.
Then on the form, change the same record to a different value, update the dataset, and attempt to write the changes to the database, which results in a concurrency error being raised.
Catch the error, then display the different versions of the record, allowing the user to determine whether to continue and update the database, or to cancel the update.
My question is, why does this even happen? Why can't I just save and edit the record from the DataGridView without causing any errors? I'm creating an app with a DataGridView and I'm facing this problem. I need some way to avoid or resolve this error without notifying the user, so whatever they see in the DataGridView gets saved exactly the way thy see it. What's the cause of that error?
The solution turned out to be pretty simple.
All you need to do is reload the data into the DataGridView again after every save.
So the code for the BindingNavigator save button is now:
this.Validate();
this.maintableBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.yourDataSet);
this.maintableTableAdapter.Fill(this.yourDataSet.yourtable);
I have no idea why this works, so I need an expert to confirm this. Working solution though.
Thanks to E-Bat for planting this idea in my head.
I'm new to Windows Phone 8 development. I've been working with it for about a month now and have written my own news app consuming data from an API. I save article content offline into the app's local storage as .json files. Since I have already them saved offline I want to give my users the ability to 'save' that article to a list of favourites and have one of my pivot items show the list of saved articles for them to access later. I also want that list manageable by the user i.e. I want them to be able to delete the items as necessary.
I'm planning on loading the data context for the list using an object called:
SavedArticles
which is simply a
List<Article>
I've read a lot about how to update the current view using INotifyPropertyChanged, but I think that is more about updating properties of existing items in the list. What I need is something that can update the ItemsSource after the user selects an item and then clicks delete in the AppBar. I think that is where INotifyCollectionChanged should come in, but for the life of me, I can't see how to implement it.
Looking for someone to enlighten me or point me at a great example.
I have Googled this to death but cannot find many examples and the ones I have seen, I'm just not getting.
Thanks!
Instead of using List<Article> use an ObservableCollection<Article> (from System.Collections.ObjectModel) as this implements INotifyCollectionChanged.
This means that when you remove an item from the underlying collection (which is what your delete function should do) then this will be reflected in the databound UI collection.
I´m currently trying to implement a virtual DataGridview in a client-server system to increase perfomance.
For that I have used follwing code suggested by Microsoft: http://msdn.microsoft.com/de-de/library/ms171624.aspx
To that point all is fine and is working out as it should. Problem is, the example doesn´t cover writing data back to database. I need users to be able to submit changes. I´ve learned that the CellValuePushed-Event is fired if the user alters any value in the GridView. After searching the web for hours now I still haven´t found a way to accomplish saving data back to database.
Do I have to update the underlying DataTable with the changed value and then refresh the Gridview?
Is there anyone who could help me out with some code or a few hints? Any help would be greatly appreciated :-)
Ok, I´ve solved this myself now. "Do I have to update the underlying DataTable with the changed value and then refresh the Gridview?" was the right way to accomplish writing the data back to database. Although I´d already tried that, I had missed out on a piece of code...