We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how to change the value of a cell?

I am doing an application that consists in a DataGrid filled only with numbers, every time that you touch a cell the value of the cell will increase one at once, when I touch the cell the application crash.

I was doing the same in Xamarin.Forms, but the application not crashed.

This is the event Tapped

private void GrdCountConcept_GridTapped(object sender, GridTappedEventArgs e)
        {
            grdCountConcept.EndEdit();

            int rowIndex = e.RowColumnIndex.RowIndex;
            int columnIndex = e.RowColumnIndex.ColumnIndex;

            List<OrderInfo> source = (grdCountConcept.ItemsSource as List<OrderInfo>).ToList();

            if (columnIndex == 0)
            {
                grdCountConcept.ItemsSource = source;
            }
            else
            {
                var recordData = grdCountConcept.GetRecordAtRowIndex(rowIndex);
                string columnName = grdCountConcept.Columns[columnIndex].MappingName;

                int cellValue = Convert.ToInt16(grdCountConcept.GetCellValue(recordData, columnName));

                cellValue++;

                switch (columnIndex)
                {
                    case 1:
                        source[rowIndex - 1].Talla4 = cellValue;
                        break;
                    case 2:
                        source[rowIndex - 1].Talla6 = cellValue;
                        break;
                    case 3:
                        source[rowIndex - 1].Talla8 = cellValue;
                        break;
                    case 4:
                        source[rowIndex - 1].Talla10 = cellValue;
                    default:
                        break;
                }

                grdCountConcept.ItemsSource = source;
            }
        }

Where OrderInfo only has int values

2 Replies

AE Abraham Esrit Ines Rivera Villegas September 3, 2017 03:04 AM UTC

You guys are a terrible suckers, I already resolved it



AN Ashok N Syncfusion Team September 4, 2017 11:53 AM UTC

Hi Abraham, 
 
Thank you for your interest in Syncfusion.  To provide some perspective, our standard turnaround time for incidents and forums is 24 hours (business days). It is our expectation that support incidents or forum posts created will be both respectful and professional in nature, and free of profanity.   
 
Regards, 
Ashok 


Loader.
Live Chat Icon For mobile
Up arrow icon