.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

Add a checkbox header in grid with autogeneratecolumns=true

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

HI! I try to add a header checkbox to selecte all in the column, I know that with templeate field you can but the problem is that i don't know the number of columns. How i add a checkbox to the header in every column?

View Complete Post

More Related Resource Links

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Populate Grid/Listbox depending on the click of checkbox of treeviewitem of treeview in wpf

Hi, I am using your TreeViewWithCheckBoxes example (http://www.codeproject.com/KB/WPF/TreeViewWithCheckBoxes.aspx) in my code. on the basis of checked state in treeview I have to populate a grid. How to go about that. Ex: If Suppose Root Child1 Child1.1 Child1.2 Child2 Child2.1 Child3 Child3.1 Child3.2 is the treeview with checkboxes, and I check, Child1.1 or Root(all treeviewitems selected) node then I have to populate a grid/listbox on the selection basis. Thanks, Manu G

Not able to save checkbox values as TRUE on record creation

I have a form I created in InfoPath 2010 on a SharePoint 2010 list. As part of this list, there are 6 yes/no columns.  Each yes/no column I have bound to a different checkbox in the InfoPath form.  In SharePoint, when I view the list and click "add new item", the blank InfoPath form appears, I edit the form and submit it.  All works fine.... EXCEPT the checkboxes.  It seems that the checkboxes always save as FALSE the first time I save a new record. If I save the new record, and then choose to "edit the item", I can set any or all of the checkboxes to true, and it works fine.  But on the initial creation of the record (using InfoPath), the checkboxes always end up being persisted as FALSE. If I create a new record directly in the list (using the datasheet view), I am able to save the yes/no fields as YES, and they persist.  So the problem really does seem to point to the InfoPath form. Any thoughts on how I can persist a TRUE value for these checkboxes when saving for the first time?

How to get Checkbox value created at runtime above gridview header


I have creted a checkbox for each column of grid at the top of the header in row created event. I need to check wheather checkbox is checked after button click event.

//Build custom header.

                GridView oGridView = (GridView)sender;
                GridViewRow oGridViewRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
                TableCell oTableCell = new TableCell();

                //Add Staff_ID
                CheckBox chkStaffID = new CheckBox();
                chkStaffID.ID = "chkStaff_ID";
                chkStaffID.Text = "Hide";
                chkStaffID.CheckedChanged += new System.EventHandler(chkStaffID_CheckedChanged);

Grid view header text


I am populating my grid view from a dataset. The dataset has two columns (case Type and Csae Description). The casetype will be the same in every row.

HIS, Bonemarrow consult

How do I display the casetype in the header row (as shown below) instead of a column.

Bone Marrow Consult

Data Grid Header


Dear All,

I have one datgrid in that there are around 200 rows.Now i want when user scroll he should able to see the header.

Request all of you to help 

Cant reuse Http connections. No KeepAlive header. HttpWebRequest.KeepAlive = true;


I tried to reuse Http connections setting KeepAlive but it simply doesnt work. I looked in the Http messages using Feedler and Charles but all I can see is Connection: close in response. I am sure I use HTTP 1.1 as it says so in the request.

I see 600 TCP connections in wait state opened by 10 threads. Each thread run one http request at a time.

There is also bunch of responses which say - the unauthenticated request. The service requires digest authentication. Why some requestes fail to be authenticated?? 

P.S. I just found this thread: http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/87bc7029-ce23-438a-a767-f7c32dcc63a7 and I tried to set UnsafeAuthenticatedConnectionSharing = true but still my TCP connections are not reused.

    static void GetRest(string rest) 

Changing image of tab header when IsSelected = True


So I have a tab control which has 4 items. The header of each of these items consists of an image and a label with text stacked vertically like the picture below:


Which I used this code for:


   <TabItem Name="tabItem2">
     <StackPanel VerticalAlignment="Center">
      <Image Source="/WpfApplication5;component/Network.png

How can I customized the column header when set AutoGenerateColumn =true


If I set the AutoGenerateColumn property to true in WPF datagrid.

How can I customized the column header ?

 I do not want the datagrid display the data object name ,I 'd like to display a friendly name .

 How can I do that ?


Beat Microsoft.

button in grid header - add click event


I have a button in a header in my grid - I would write a function in the vb.net code behind to fire when the button is clicked?

Do you a code sample??


How to check CheckBox.IsChecked property if CheckBox is in header of ListView/GridView with grouping


Sorry for this difficult title :P

So what exactly I need? I will try to explain it step by step as easy as possible.
My question is on the end of this post, but to understand my issue is better to read all steps.

First have a look on this post http://msdn.microsoft.com/en-us/library/ms754027(v=VS.90).aspx

1) I am implementing allmost the same code. 
But I changed one TextBlock (in Expander.Header) for a CheckBox:

<ListView x:Name="ExampleListView"
 ItemsSource="{Binding Source={StaticResource Src}}"

 <GridViewColumn DisplayMemberBinding="{Binding Path=PropertyOne}" Header="One" />
 <GridViewColumn DisplayMemberBinding="{Binding Path=PropertyTwo}" Header="Two" />


Calculate The Value of checked grid checkbox using javascript



         i am using a grid view with a check box, after binding the data on data grid it genrated 5 row with checked, check box, now i want when user uncheck some of check box then the value related to previous collumn of row are substracted from total value, and as user check some of check box again then the total will be filled again.

for this process i write the code as:

<script type="text/javascript">
    function CheckChange(id) {
        var grid = document.getElementById("<%=grdViewClearingSchedule.ClientID  %>");
        var cell;
        var amt;
        var TotalAmt = parseFloat("0");
        if (grid.rows.length > 0) {
            for (i = 1; i < grid.rows.length; i++) {
                cell = grid.rows[i].cells[5];

                if (cell.childNodes[0].type == &quo

Gridview header checkbox select and deselect all rows using client side JavaScript and server sideC#

In this article, I will show you how to add checkbox in gridview header template then select and deselect all rows in gridview using clients side JavaScript and server side as well.

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.

Gridview setup:

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

jQuery: Highlight Gridview Rows with Checkbox

Im learning and experimenting with jQuery and ASP.NET. Below is a simple solution I created to highlight rows in a gridview by clicking on a checkbox next to the row.
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