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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to re-enable virtualization in WPF DataGrid after adding, then removing a GroupStyle ?

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :WPF

I would like to use grouping, with an ObservableCollection, in the WPF DataGrid. 

Unfortunately, adding the GroupStyle causes virtualization to be lost.

What I can do, which I believe would help quite a bit, is to add the GroupStyle programmatically when grouping is requested, then remove the GroupStyle when the list is un-grouped.

I found out though that removing the GroupStyle doesn't re-enable virtualization.

Can someone tell me how to re-enable virtualization? 

Thank you very much!

View Complete Post

More Related Resource Links

Adding items to ObservableCollection via DataGrid

Hi All, I have a DataGrid bound to an ObservableCollection. I'd like to be able to add objects to the collection via the Grid. When I was working with sample data, I could go to the bottom of the grid, hit enter and add a new entry. Now that I'm using real data I don't seem to be able to do that. I tried taking a look at the class that the SampleData creates and can't quite fathom what it's up to. Does anyone know what I'm missing \ what I need to implement to make this possibe? Thanks Warrick

Adding, removing or editing the items of combobox.....

Hello everyone, I am working on this application which requires Items of the combobox added, edited or removed by the end user in the different section of the application such as settings window or something like that. I guess If we bind the Combobox to the database where we could easily add , remove or edit the items of combox but for the application that doesn't use database that creates a lot of overhead. To demonstrate that Here is my sample application Window1.xaml <Window x:Class="MySampleApplication.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" Title="Window1" Height="300" Width="300" xmlns:local="clr-namespace:MySampleApplication" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> <Window.Resources> <local:StringsLenToBooleanConverter x:Key="mvc"/> </Window.Resources> <Grid> <ComboBox Height="26" Margin="12,75,12,0" Name="comboBox1" VerticalAlignment="Top"> <s:String>Red</s:String> <s:String>Blue</s:String> <s:String>Green</s:String> </ComboBox> <Button Height="28&quo

HDI : Enable and Disable checkboxes inside of DataGrid Template

I am again trying stuff that is a challenge.What i need to do is to enable and disable checkboxes in the gridI enable/disable them when i bind in grdDocApprovals_ItemDataBoundusing the following syntax( (CheckBox)e.Item.FindControl("chkReceived" )).Enabled = true;( (CheckBox)e.Item.FindControl("chkApproved" )).Enabled = false;That works wonderful. It disables the checkbox and i can not tick it.Now the problem comes in when i Tick the chkReceived box then i executemy javascript that finds the chkApproved box and is suppose to enable it.I noticed that in the HTML code during runtime there is a span and a td thatsurrounds the chkApproved. The <span>have a disabled = 'disabled' tag.and no matter what i do i can not get the chkApproved to be enabled. <span disabled="disabled"><input id="_ctl0_ContentMain_grdDocApprovals__ctl3_chkApproved" type="checkbox" name="_ctl0:ContentMain:grdDocApprovals:_ctl3:chkApproved" disabled="disabled" onclick="javascript:return response(this);" /></span>what can i do to get it active?

WebConfigModifications.Remove() is adding instead of removing

I implemented the FeatureDeactivating event just like the activated event except I used the Remove() method instead of Add(). From all the articles I found this is what you're supposed to do, but perhaps I'm missing something.  I also tried removing all modifications for a specific owner, which resulted in duplicating every modification that owner made.  Everything seems to suggest that the Remove() method is actually adding entries. Here is my code, can someone tell me if I've done someting wrong or if this is a bug? using System; using System.Runtime.InteropServices; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePoint.Security; using Microsoft.SharePoint.Administration; namespace Sample.Features.Feature2 { [Guid("3eac000f-333d-4ee2-a961-2eda341b6c66")] public class Feature2EventReceiver : SPFeatureReceiver { public override void FeatureActivated(SPFeatureReceiverProperties properties) { // Create a configuration object SPWebConfigModification config = new SPWebConfigModification(); config.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode; config.Owner = "Sample"; config.Name = "WorkflowService[Class='ClassLibrary1.CustomService']"; config.Path = "configuration/SharePoint/WorkflowServices";

Adding new rows to Datagrid with a Combobox column generate "two-way binding requires path or xpath"



    I have datagrid control with a template combobox column like:

 <DataGridTemplateColumn Header="Fault code" Width="75">
                                    <TextBlock Text="{Binding FaultCode1}" />

How to implement (DataGrid) Virtualization in WPF


I have DataGrid control in one of the Window of my WPF Project.

Right now I'm loading the content of the DataGrid by assigning a DataTable.

Now I would like to use Virtualization concept for loading the content of DataGrid.
Can any one tel me how to implement that.

Please if possible provide me some samples.

Adding a toolstrip to a datagrid


Guys, i need some help

i am a complete newbie

i am trying to add a tollstrip to a datagrid form i created

i would like the toolstip to provide simple navigation and modification option on that grid, i was able to add one to an empty form, but incorporating the code to my existing form result in nothing, and i don't know why.

i have no idea where to start


'Import Data and SqlClient namespaces
Imports System.Data
Imports System.Data.SqlClient
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms

Public Class AccountTypes
  Inherits System.Windows.Forms.Form
  Private toolStripContainer1 As ToolStripContainer
  Private toolStrip1 As ToolStrip

  Dim objConnection As New SqlConnection _
    ("server=;database=db;User Id=sa;Password=pass;")
  Dim objDataAdapter As New SqlDataAdapter
  Dim objDateSet As New DataSet()

  ' Dim DataGridView1 As String

  Private Sub AccountTypes_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

      ' Set the select command properties..
      objDataAdapter.SelectCommand = New SqlCommand()
      objDataAdapter.SelectCommand.Connection = objConnection

How to enable adding search web parts in a site?

I have a publishing site and i don't see the option to add search box web part in the "add web part" gallery. What should be configured?
keren tsur

Enable TextWrapping in a DataGrid .NET 4 DataGridTextColumn


I have a DataGrid that is populated with data from a DataTable.DataView.  The data in the DataTable is created on the fly based upon the criteria returned from LINQ to SQL DataClass.

When the Datarid is populated with data it shows the correct data, but the columns are too wide and there is no TextWrapping enabled.

I do not know before the DataGrid has its ItemSource property bound to the DataTable how many columns of data will be but I need to set the property of any cells carrying text to have the wrap property enabled.

I've scoured many forums and can't find the solution.  Can anyone help?


Thank you.

Removing/Adding in Ribbon.PublishTab.Publishing section



I'm dealing with ribbon customization and it's working quite well. But when I try to change (remove or add) buttons to Ribbon.PublishTab.Publishing it is not working:

<CustomAction Id="

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

How Do I Enable Inline GridView Editing?

Now that you have created a site with Edit and Details views, how do you enable inline editing in a GridView control? This video shows you how, and also touches on routing.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Use Jquery with repeater, gridview, datagrid

Before we talk about jquery inside any itemtemplate (repeater, gridview, datagrid), we need to understand the basic use of jquery functions

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

ListBox tricky to set in a DataGrid/GridView

Listboxes are very tricky to set selected items in grid - there is no real nice way to do it. It would have been great if Microsoft included a property that accepts an array or comma separated values - or anything! But they only allow each item in the list to be selected individually. The way to do this in a grid is a bit messy, but it is fairly simple to implement. When a row is created (as per the event), select the items of the listbox as per the datagrid source data:
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