//Event subscription.
gridControl1.CheckBoxClick += GridControl1_CheckBoxClick;
//Event customization
private void GridControl1_CheckBoxClick(object sender, GridCellClickEventArgs e)
{
//Code to perform your behavior.
} |
gridControl1.CheckBoxClick += GridControl1_CheckBoxClick;
private void GridControl1_CheckBoxClick(object sender, GridCellClickEventArgs e)
{
string check = cellValue.ToString();
if (check == "0")
for (int i = 1; i <= gridControl1.RowCount; i++)
{
gridControl1[i, 3].CellValue = "1";
gridControl1.InvalidateRange(GridRangeInfo.Cell(i, 3));
}
else
for (int i = 1; i <= gridControl1.RowCount; i++)
gridControl1[i, 3].CellValue = "0";
} |
private void GridControl1_CheckBoxClick(object sender, GridCellClickEventArgs e)
{
//To move the current cell.
gridControl1.CurrentCell.MoveTo(e.RowIndex,e.ColIndex);
//To invoke the CurrentCellValidated event.
gridControl1.CurrentCell.Validate();
} |
this.sfDataGrid1.View.RecordPropertyChanged += View_RecordPropertyChanged; private void View_RecordPropertyChanged(object sender, PropertyChangedEventArgs e) { var record = (sender as OrderInfo).IsClosed; //You can customize here. } |
public class OrderInfo : INotifyPropertyChanged
{
bool ischecked;
int orderID;
string customerId;
string country;
string customerName;
string shippingCity;
public int OrderID
{
get { return orderID; }
set
{
orderID = value;
OnPropertyChanged("OrderID");
}
}
public string CustomerID
{
get { return customerId; }
set
{
customerId = value;
OnPropertyChanged("CustomerID");
}
}
public string CustomerName
{
get { return customerName; }
set
{
customerName = value;
OnPropertyChanged("CustomerName");
}
}
public string Country
{
get { return country; }
set
{
country = value;
OnPropertyChanged("Country");
}
}
public string ShipCity
{
get { return shippingCity; }
set
{
shippingCity = value;
OnPropertyChanged("ShipCity");
}
}
public bool IsChecked
{
get { return ischecked; }
set
{
ischecked = value;
OnPropertyChanged("IsChecked");
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string PropertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
}
public OrderInfo(bool ischecked,int orderId, string customerName, string country, string customerId, string shipCity)
{
this.IsChecked = ischecked;
this.OrderID = orderId;
this.CustomerName = customerName;
this.Country = country;
this.CustomerID = customerId;
this.ShipCity = shipCity;
}
}
|