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

GridView Master-Detail representation with Card view detail

6 Answers 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 1
Igor asked on 23 Feb 2010, 10:23 AM
I downloaded RAD Controls for WPF set and didn't manage to find in Demos an example of master-detail representation of a GridView. For example, for OrderHeader - OrderLines view implementation. How is it possible to set detail part of a view as CardView with the possibility of editing database records?

6 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 23 Feb 2010, 12:12 PM
Hi Igor Panteleev,

Our online and downloadable demos contain special section that demonstrates master-detail scenarios. You can find those demos under GridView -> Hierarchy. You could also take a look at our documentation.

CardView is not available at the moment but you could possibly create a custom row style which mimics cardview appearance. Our Custom Row Layout sample could be used as a reference.

One way to integrate database access easily it to use Entity Model. I have prepared a sample application that demonstrates this approach. As you will see, saving changes is as easy as calling a single method.You could also try our own Enterpris-grade ORM tool called OpenAccess 


Regards,
Milan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Igor
Top achievements
Rank 1
answered on 23 Feb 2010, 12:59 PM
Hi Milan,

Thanks for your answer and for an attached example.
Is it possible to work with a database using "LINQ to SQL" and save DataGrid changes in an as convenient way as in your example?
Do you have an example for such way of implementing database integration (LINQ to SQL)?

Best Regards,
Igor
0
Milan
Telerik team
answered on 23 Feb 2010, 03:05 PM
Hi Igor Panteleev,

Using LINQ to SQL is just as easy as using Entity Framework. I have updated the original sample to use LINQ to SQL as well.


Regards,
Milan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Igor
Top achievements
Rank 1
answered on 23 Feb 2010, 05:33 PM
Hi Milan,

Thanks, I tried, as you suggested, and everything works Okay.
Could you, please, tell, if there is a way to organize GridView to database interconnection (better using LINQ to SQL, if possible) so that data in a GridView were updated continuously not only at the moment of opening the window which contains GridView?

Best Regards,
Igor
0
Igor
Top achievements
Rank 1
answered on 23 Feb 2010, 05:38 PM
Hi Milan,

Thanks, I tried, as you suggested, and everything works Okay.
Could you, please, tell, if there is a way to organize GridView to database interconnection (better using LINQ to SQL, if possible) so that data in a GridView were updated continuously not only at the moment of opening the window which contains GridView?

Best Regards,
Igor
0
Milan
Telerik team
answered on 24 Feb 2010, 02:58 PM
Hello Igor Panteleev,

You can use the Refresh method of the SQLDataContext to update the data.  Here is the updates code for Windows!.xaml.cs - here I am using DispatcherTimer to update the data every 30 seconds (be advised that data update can be slow)

AdventureWorksEntities dataContext;
DataClasses1DataContext sqlDataContext;
  
IQueryable<Contact> sqlData;
  
public Window1()
{
    InitializeComponent();
  
    this.dataContext = new AdventureWorksEntities();
  
    var data = from customer in this.dataContext.Customer
               where customer.TerritoryID == 4
               select customer;
  
    this.playersGrid.ItemsSource = data;
  
    this.sqlDataContext = new DataClasses1DataContext();
  
    this.sqlData = from contact in this.sqlDataContext.Contacts
               where contact.FirstName.Contains("a")
               select contact;
  
    this.playersGrid2.ItemsSource = sqlData;
  
    DispatcherTimer timer = new DispatcherTimer();
    timer.Interval = TimeSpan.FromSeconds(30);
    timer.Tick += new EventHandler(timer_Tick);
    timer.Start();
}
  
void timer_Tick(object sender, EventArgs e)
{
    this.sqlDataContext.Refresh(System.Data.Linq.RefreshMode.KeepChanges, this.sqlData);
}
  
private void Button_Click(object sender, RoutedEventArgs e)
{
    this.dataContext.SaveChanges();
    this.sqlDataContext.SubmitChanges();
}


Regards,
Milan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Igor
Top achievements
Rank 1
Answers by
Milan
Telerik team
Igor
Top achievements
Rank 1
Share this question
or