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

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

Datagrid and Checkboxes

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

I have a datagrid with a checkbox column. In order for a checkbox to be checked, the user must click twice even if they are over the checkbox square.

The first click selects the datagrid row's field with the checkbox in it.

The second click then checks the checkbox.

Is there a way to have it check the box on the first click?

View Complete Post

More Related Resource Links

Checkboxes in Datagrid


This morning I posted a question w.r.t Radio Buttons, but the requirement changed so I'm posing a similar question.

I want to have a checkbox in a datagrid.

Suppose I click on one of the checkboxes and then realize i need to click on another, the screen has to automatically uncheck the previously clicked checkbox and then check the newly clicked checkbox.

In other words I need to clear previously checked checkboxes and check the recently clicked checkbox.

Also, I need to update a label in the page with a value associated with the row of the checked checkbox.

I should not be using a javascript to do this.

Any help in this regard would be highly appreciated.

Checkboxes in Datagrid

Hello Group, I have a question about dynamically generated checkboxes in a grid view. These checkboxes are checked depending on a value from the database. This is al working fine. I want to check or uncheck some checkboxes on different lines and when i push a button i want to receive the values of the checkboxes, but i can accomplish this.   Anyone who can help me? René

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?

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:

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.

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

A datagrid control that can be personalized... anyone??


Hello all,

I need a datagrid control that has following features, besides other regular stuff like paging, sorting, filtering, etc:

The user should be able to -

1. Select columns to view

2. Select column Sequence

3. Select default sort column

4. Store the setting (as a view) and use it on next visit.

5. llow multiple such views to be stored for a user for future use.

All these settings should be saved and when the user comes back he gets the same settings.

Really appreciate your time and would love to get any ideas.


- Zen

CheckBoxes In Asp.net MVC


Hi Guys,

I am new to asp.net mvc.. i have a question that how to deal with the checkboxes in the asp.net mvc and how to apply the validation on that ??? what i want is i have a checkbox against Email textbox and if that checkbox is selected than email must be entered..how do i do that ??

Hoping a reply as soon as possible..

Thanks a lot in advance..

Checkboxes from data table


I have a data table that contains some values for Certifications.  This table can be updated in a different part of my application.  On the web page I am currently working on, I would like to have check boxes appear for every value in the data table.  I have been struggling with this trying to use a For Each loop and I cannot get it to work for anything.  Any suggestions? 

I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):


var db = Database.Open("MyConn");



Dropdownlist Show the all PatientName and save the PatientID in the database and in datagrid showing the PatientID my requirement is that the PatientName show in DataGrid.

how to do ? 

Cutting Edge: Moving DataGrid Rows Up and Down


Imagine opening your Inbox one morning and finding a message that reads "Dear Mr. DataGrid, I urgently need an ASP.NET DataGrid that lets my users move rows on the client. You're my last hope. Will you please help me?"

Dino Esposito

MSDN Magazine March 2005

GridView: Move Over DataGrid, There's a New Grid in Town!


When incorporating the ASP.NET DataGrid control into your Web apps, common operations such as paging, sorting, editing, and deleting data require more effort than you might like to expend. But all that is about to change. The GridView control--the successor to the DataGrid-- extends the DataGrid's functionality it in a number of ways. First, it fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, as long as its bound data source object supports these capabilities. In addition, the GridView control offers some functional improvements over the DataGrid. Here DataGrid expert Dino Esposito introduces the GridView and explains all its long-awaited features.

Dino Esposito

MSDN Magazine August 2004

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