I have a devexpress gridview, and in one of the columns is a checkbox. I want to check to see if the checkbox in that column is selected in the focused row, and if so, perform some action. How should I go about checking if the checkbox is checked?
-
Please post the code for this.Brian– Brian2013-02-28 19:30:53 +00:00Commented Feb 28, 2013 at 19:30
-
Do you use data-bindings? Adding some code would help us. I don't know the technologies, where DevExpress grids are available for. WPF? Silverlight? ASP.NET? WinForms?Michael Schnerring– Michael Schnerring2013-02-28 20:04:54 +00:00Commented Feb 28, 2013 at 20:04
Add a comment
|
4 Answers
If you are using DataBinding it is very easy. For example:
public class MyClass(){
public MyClass(){
}
public bool IsTrue
{
get{;}
set{;}
}
}
List<MyClass> manyMyClassObjects = new List<MyClass>();
//Add some values for sure
GridControl.DataSource = manyMyClassObjects;
Now the IsTrue property is binded to the Grid. The GridView just present the underlaying Data. If you change a value in the Grid it changes the value of your DataSource Object. This will work with any Property which implements a setter for sure.