Thanks. I'm also curious why the GridSwitchColumn shows as a checkbox and not as a switch (in Android).
Hi Tino,We cannot able to listen the Tap action on the Switch while change the value, already we will consider this as feature enhancement of GridSwitchColumn and this GridSwitchColumn events support will be available in our upcoming 2017 Vol 3 SP2 release, which will be schedule for rolls out end of September. We appreciate your patience until then.Regards,Ashok
Hi,
Can you tell me when this will be available please. You mention end of September, but as far as I can see the latest release was on 7 August.
https://www.syncfusion.com/downloads/latest-version
I really need this functionality.
sfGrid.CellRenderers.Remove("Switch");
sfGrid.CellRenderers.Add("Switch", new Gridswitchcontrol());
//Custom Renderer Class
public class Gridswitchcontrol:GridCellSwitchRenderer
{
public Gridswitchcontrol()
{
}
public override void OnInitializeDisplayView(DataColumnBase dataColumn, SfSwitchControl view)
{
base.OnInitializeDisplayView(dataColumn, view);
view.Toggled += View_Toggled;
}
private void View_Toggled(object sender, ToggledEventArgs e)
{
//Your Requirement here
}
} |
[C#]
dataGrid.GridLoaded += DataGrid_GridLoaded;
private void DataGrid_GridLoaded(object sender, GridLoadedEventArgs e)
{
// if we call ValueChanged event in Grid Loaded value changed will not
// raised in initial loading.
dataGrid.ValueChanged += DataGrid_ValueChanged;
//Sum of rows being checked.
var count = viewModel.OrdersInfo.Count(x => x.IsClosed);
}
private void DataGrid_ValueChanged(object sender, Syncfusion.SfDataGrid.XForms.ValueChangedEventArgs e)
{
if(e.Column.MappingName == "IsClosed")
{
// Calculating sum of rows checked when the grid switch column value is changed.
var count = viewModel.OrdersInfo.Count(x => x.IsClosed);
}
} |