.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Using PagedCollectionView To Group DataGrid Records Using MVVM

Posted By: Asim Sajjad     Posted Date: September 11, 2011    Points: 2   Category :Silverlight
 
When using data grid control sometime we provide grouping of data so that user can see records in groups but the groups are predefine and If you don't want to see the group which we the developer or the client provide then he/she can't change. So here we can use approach to provide the grouping of data to the end user if he/she want to see the data grid records in groups then he/she can arrange records in groups but if he/she don't want to see the he/she can remove the grouping of records.


View Complete Post


More Related Resource Links

SSAS 2008 attritube hierarchy doesn't group records and repeat rows

  
We are having problems with the dimension attributes in lower level hierarchies not grouping under 1 single level. Here is the hierarchy: VP    College      Department         Departmental Course            Course Level               Course Number The top 3 levels are grouping correctly without duplicate rows and they don't have compoud keys. The lowest 3 levels are not grouped correctly and they have compounds keys because the attributes are not unique by themself. The result of the hierarchy looks like this: VP Academic Affairs    Business School of Management        International Business School            Mgm101                 Lower                       Course Number 123            Mgm101                Upper                

delete button in datagrid in MVVM not working

  
i have a datagrid. i have added a delete button as data template. but on button click, the event is not firing .  <sdk:DataGrid AutoGenerateColumns="False"                       Height="94"                       HorizontalAlignment="Left"                       Margin="0,53,0,0"                       Name="dataGrid1" VerticalAlignment="Top" Width="560"                       ItemsSource="{Binding SelectedComponentInfo.FilterComponentCriteriaMapping}"                       SelectedItem="{Binding SelectedMappingInfo, Mode=TwoWay}" CanUserReorderColumns="True" CanUserResizeColumns="True" DataContext="{Binding}">    

delete button in datagrid in MVVM not working

  
hi all, i am using VS 2010 with silverlight 4.0. i have a datagrid. i have added a delete button as data template. but on button click, the event is not firing .  <sdk:DataGrid AutoGenerateColumns="False"                       Height="94"                       HorizontalAlignment="Left"                       Margin="0,53,0,0"                       Name="dataGrid1" VerticalAlignment="Top" Width="560"                       ItemsSource="{Binding SelectedComponentInfo.FilterComponentCriteriaMapping}"                       SelectedItem="{Binding SelectedMappingInfo, Mode=TwoWay}" CanUserReorderColumns="True" CanUserResizeColumns="True" DataCon

delete button in datagrid in MVVM not working

  
hi all, i am using VS 2010 with silverlight 4.0. i have a datagrid. i have added a delete button as data template. but on button click, the event is not firing .  <sdk:DataGrid AutoGenerateColumns="False"                       Height="94"                       HorizontalAlignment="Left"                       Margin="0,53,0,0"                       Name="dataGrid1" VerticalAlignment="Top" Width="560"                       ItemsSource="{Binding SelectedComponentInfo.FilterComponentCriteriaMapping}"                       SelectedItem="{Binding SelectedMappingInfo, Mode=TwoWay}" CanUserReorderColumns="True" CanUserResizeColumns="True" DataCon

Binding DataGrid RowDetailTemplate Using MVVM

  
In this post I will show you how you can bind the RowDetailTemplate of the data grid using the MVVM pattern. Below are the image of the sample code here you can see the default page in Image 1 and when user click on any of the record then detail of the record is shown in the RowDetailTemplate which also consist of the data grid control which you can see in the Image 2.

WPF Datagrid multiple selecteditems in MVVM

  

Hi,

I have a Datagrid (VS 2010 .NET 4) and using MVVm pattern in my application. I need to build a context menu that allows to perform an operation on one or more selected rows of the underling datagrid. I don't understand how to send the list of selected items to the view model from the view. Can anybody help me out.

Thanks

Vijay


combobox in datagrid with MVVM Pattern

  

Hi

  i have requirement that, datagrid has a two column one is text column and other is combo box, combo box contain 2 column including checkbox. once i click the checkbox in combobox, resepective first column value need to display in combo box selected item and second column values need to display in first column of the data grid.

  I have used following code in xmal

 

<DataGrid x:Name="dgMixture"  VerticalAlignment="Top"  Width="250"
                      RowHeight="25"  GridLinesVisibility="Vertical" HeadersVisibility="Column" IsReadOnly="True"  AutoGenerateColumns="False"
                      HorizontalAlignment="Left" CanUserAddRows="False" ItemsSource="{Binding CompanyItemsCV}"   >
                <DataGrid.Columns>                   
       &nb

How can I clear all selected items of a radio button group in WPF - MVVM?

  
Hi I have a group of radio buttons bound to a property in View model. Now, on check of one of the button, i perform some action through property. My use case is when ever the action is failed, i want to reset checked button and set the earlier one. For this, i have reset the property value in seter itself but it is not reflected on UI. A workaround for this would be to clear all checked buttons from radio button group. How can we achieve it?? thanks in advance Swapnil

Group records and deleting previous records.

  

Hi All

I have a staging table that contains records from multiple file loads, the way that the files are loaded in the table are by “Chronological Order (List files by the oldest first)”

MAPPING NAMES

1 - Chronological Order = C.Order

2- Data Point = DP (it’s like data fields)

3- The PK is on Date and UserID for each file (not on the table).

So what I have in my table is like

C.Order                                 Date &nbs

Cannot Automatically Refresh WPF Datagrid (MVVM / Prism)

  

I'm developing MVVM application. I bind the DataGrid ItemsSource to a ObservableCollection in the ViewModel code. Every user control (eg. TextBox, Label, etc) in the UI except the DataGrid works fine. When the PropertyChanged event is fired, the value is displayed correctly. But not in the DataGrid, I use TwoWay mode, but it seems that the DataGrid never refresh itself. The DataGrid content is refreshed only when I try to sort any DataGrid column.

ViewModel

public ObservableCollection<CartItem> Cart
{
	get	{
		return cart;
	}
	set	{
		cart = value;
	}
}
public ObservableCollection<CartItem> cart;

public CartItem CurrentCartItem
{
	get	{
		return currentCartItem;
	}
	set	{
		currentCartItem = value;
		// Update the Price value programatically, 
		// It works fine when this value is bound to a common control such as TextBlock
		currentCartItem.Price = CurrentCartItem.Quantity * CurrentCartItem.PricePerUnit;
		NotifyPropertyChanged(

Add, Modify, Delete Screen with a Datagrid on top listing all the records

  

Hi,

I have the requirement of creating an Add, Modify, Delete Screen with a Datagrid on top listing all the records. This needs to be incorporated using WPF with .Net 4.

1. I have to create a Base Control which holds a Datagrid and a tool bar with Add, Modify, Delete and Cancel buttons.
2. I have to create a Control (detail) having some fields like name, address, dateofbirth, etc. I need to inherit the above base control in this detail control to override events like btnAdd_Click, btnModify_Click, btnDelete_Click, etc.

Please let me know how to achieve this in WPF, I am facing couple of problem here:

1. I followed the approach mentioned in the below link.

http://svetoslavsavov.blogspot.com/2009/09/user-control-inheritance-in-wpf.html

Following this approach I am using a wpf custom control for my base control. But I am not sure if its good to place my Datagrid in Generic.xaml. Even with this approach I am facing problems in wiring up Datagrid Events from Generic.xaml to my custom control (my base control) class.

Please give a example solution for this problem.


Nested DataGrid - Accessing parent selected row from child in MVVM

  
Hi All,

I have a nested datagrid. The child datagrid is inside the RowDetailsTemplate.
I have expander and collapse button to open the child datagrid. When i select the expander/collapse button, the row of the parent datgrid gets selected and the child datagrid is loaded with data. Next, i select the child datagrid row. So the problem is when i am selecting the child datagridrow, the parent datagrid row selection should be deselected.

This needs to be achieved in MVVM

Please help.

Drag & Drop expander group / rows in datagrid

  

Hello,

I am wondering how I can find some help, sample about reordering datagrid rows by using drag & drop feature.

In my case, I have a grid (.NET 3.5 gridview in a listview or WPF Toolkit Datagrid) bound to a CollectionViewSource with 2 propertyGroupDescriptions (Category/Sub category)

I need to be able to reorder rows either by using drag & drop on rows or on group descriptions (represented by expanders)

I've past my day with my friend google to find some info, but without any success...:(

Someone have already done this ?

By advance, thank you for your help

Patrice


caml query - group by column and get count of records

  

Hi,

I want to group by on column name and get the count of records returned.

 

 


WPF 4 Datagrid CRUD MVVM

  

Hello !

I`m looking for a good practice of CRUD operations( MVVM pattern  with WPF 4 Datagrid and List <T>  (observable collection ))  -  all examples not so good or inconvinient

I have  GetAllUsers,  AddUSER, UpdateUSER, DeleteUSER methods ( WCF methods )

 

class User

{

Guid ID;

string Login;

string Password;
Employee Employee;
}




 

Thanks for any suggestion!

 



Binding Command Inside DataGrid Using MVVM

  
In this post I will show you how to bind the commands inside the data grid control using MVVM pattern. For this post I have continue my last post which is used to explain the data pager using MVVM. For this post I have added DelegateCommand class which is added in the Classes folder. I have only one command in the viewModel (with the name HomeViewModel and is located in the ViewModel folder). The view for the Home is located in the View folder. Here you can see that I have added the HomeViewModel as resource in the home view which you can see in the Image 1.

Selecting One Checkbox Control In DataGrid Control Using MVVM Using Silverlight

  
In this post I will show you how to select single check-box control when you have single check-box control in each row of the datagrid control. As you all know that check-box controls are normally used for the multiple selection and radio buttons are used for single selection. But there are sometimes requirement that control should be check-box and selection should be single. Mean if user view data in the datagrid control then he/she should only select one check-box at a time not more then one. Main page is shown in the Image 1. Here you can see that I have placed check-box control in the first column of the datagrid control which I have also highlighted.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend