.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

Editable Header for DataGrid

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :WPF
Hi I want to have  wpf datagrid header   editable.   How can i add textblock or input field in datagrid header  

View Complete Post

More Related Resource Links

DataGrid editable

Basically the idea is to have the excel spreadsheet effect. How do we make a datagrid editable?

How to have all rows of a datagrid editable (ASP.NET 1.1)

HelloI have a datagrid and I would like to know if there is a way to make all rows editable, currently now I have the user selecting a checkbox on the leftmost column that makes the row editable (using the EditItemIndex property). Thanks, 

fully editable datagrid in asp.net

I need to create 50*4 matrix of text boxes to accept values from user in an asp.net page. its very difficult to mannualy add each text box and write code to handle them.Please suggest me some thing. can it be done using fully editable datagrid, please suggest me some linksthanks

How to scroll the DataGrid (horizontally) when user drags a column header far left or right?

We're working with the WPF DataGrid and I have a question about  dragging column headers: The grid lets the user rearrange the columns, by dragging the column header left or right.  So far, so good. But, sometimes we have many columns, and only the first few columns are visible; so there is a horizontal scrollbar.  In such case, if the user drags a column header to the right edge of the DataGrid window, I want the DataGrid to scroll, automatically, one column at a time.  Is there an easy way to do that? (To be clear: yes, the user can already scroll horizontally by interacting with the horizontal scrollbar, but that isn't what I'm asking about.  I'm asking if the "drag a column header left or right" gesture can cause the DataGrid to scroll left or right.) I guess I could handle various low-level events, but it seems like it shouldn't be necessary -- DataGrid has so much functionality built-in, that I'm guessing it already has the ability to scroll when the user drags the column header to the edge.  So, is there either (a) a property that I can set, to tell the DataGrid to scroll when the user drags a column header to the edge of the window;  or (b) a code example showing how to achieve this effect myself?  Thanks!

Access a control placed inside header template of a datagrid in WPF



I have a requirement to add filters to a datagrid. I have placed the filter controls in the headertemplate of a datagrid. How can I access these controls in code behind? I need to set itemsource for the listbox placed in header template through code behind on the basis of certain selections by user. Following is my data template(resource template) for header column.

<DataTemplate x:Key="buttonResourceTemplate">
      <StackPanel Name="spResource" FlowDirection="LeftToRight" Orientation="

browser compatibility problem with datagrid with fixed header using CSS way


Hi Everybody,

I am trying to create a datagrid with fixed header and I was using the CSS way to implement this using:


However, this only works in IE and not in FF. The other alternative that I found was to create the header in a separate table and to use scrollbars on the datagrid. But, I want to stick to the first option and want to make it work on both browsers. The problem is I don't know how. Any inputs on this is greatly appriciated.


WPF: Binding Dictionary to DataGrid and making it editable.



Basically, I would like to make  "Property Editor" using Dictionary and DataGrid by storeing "properties" (key&value pairs) into Dictionary and DataGrid to display and edit. 

I was able to successfully bind using below code.

It displays Key&Value pairs fine in the DataGrid but it won't allow me to edit the Value.

It says, "EditItem is not allowed for this view"

How can I do this using DataGrid and Dictionary?

Is there better way to make property editor with FLEXIBLE number of properties?

I emphasized "flexible" because the property entries/definition can frequently change and I thought Dictionary was perfect for this.

Thanks a lot!


 <DataGrid Name="PropertyGrid"
      				<DataGridTextColumn Header="Name"
 Binding="{Binding Path=Key}"
      				<DataGridTextColumn Header="Valu

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

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

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:

Create ToolTip for GridView Header

The following allows you to add a tooltip to the header links of your GridView, a feature that is lacking.

How to highlight datagrid or GridView row on mouse over?

This article will show how you can Ajax with GridView to display popup messages when mouse moves over certain column. In the demo project I have added first column as an image column with a help icon in it. This kind of implements a feature that if you want more information about the row you can move mouse over this icon, a asynchronous request is sent to server for data about that row and when call returns the returned message is show as a popup message.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Rendering ASP.NET Script References into the Html Header

One thing that I've come to appreciate in control development in ASP.NET that use JavaScript is the ability to have more control over script and script include placement than ASP.NET provides natively. Specifically in ASP.NET you can use either the ClientScriptManager or ScriptManager to embed scripts and script references into pages via code.

Using the WPF Toolkit DataGrid

WPF comes with a large number of built in controls, but from the beginning it has lacked something that many application developers find extremely important - a DataGrid. You can use the ListView to create something approximating a DataGrid
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