Munna on .net

Masudur Rahman (Munna) is sharing ideas and interesting learning experience on Microsoft dot net framework

Recent posts

Tags

Categories

Navigation

Pages

Archive

Blogroll

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Xceed Grid Check box Column and Single Click Edit

In some cases we need to put a column with check box, so that we can select some row with check box. And then perform some operation depending on check box value. Xceed provide a very simple and easy way to accomplish this task. All you need to do is to add a column and set is data type to bool that’s it you are done.

XceedGridWithChekbox

grid.Columns.Add( new Column( "CHECKBOX", typeof( bool ) ) );

grid.Columns["CHECKBOX"].Title = "";

grid.Columns["CHECKBOX"].Width = 100;

grid.Columns["CHECKBOX"].Fixed = true;//XceedGrid 3.1

 

Now how do you set or get checked state from the column. Well when creating a new data row you simple put true or false to the value of the cell. If you assign false the checkbox will be unchecked and vice versa.

 

//setting values

Xceed.Grid.DataRow row = this.grid.DataRows.AddNew();

row.Cells["CHECKBOX"].Value = false;

foreach(DataRow row in grid.DataRows)

if((bool)row.Cells["CHECKBOX"].Value == true)

{

//do some work

}

Posted: Oct 12 2006, 12:24 by munnaonc | Comments (1) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

sex games United Kingdom said:

sex gamesVery interesting post - Might be old new, but it was new to me. Thanks.

# February 08 2010, 06:49
Comments are closed