Changing value of Custom Control in GridGroupingControl changes all other cells to same value

Hey all, I'm encountering an issue with using an Advanced Date Time Picker control for a column.

When I change the value of once cell, all other subsequent cells are also changed. 

Here is some code of how I've setup the column.

NullableDateTimeAdvPicker sampleDatePicker = new NullableDateTimeAdvPicker();

sampleDatePicker.ValueChanged += new EventHandler(sampleDatePicker_ValueChanged);


GridColumnDescriptor sampleDateColumn = new GridColumnDescriptor("SampleDate");

sampleDateColumn.Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.Control;

sampleDateColumn.Appearance.AnyRecordFieldCell.Control = sampleDatePicker;

grdSamples.TableDescriptor.Columns.Add(sampleDateColumn);


I've attached a video of what is happening when changes are made. I've also tried this with standard WinForms controls such as DateTimePicker and the same thing will happen.


I thought maybe using 

sampleDateColumn.Appearance.AnyRecordFieldCell.Control.Validated += grdSample_SampleDate_Validated; would help with getting details from the control but haven't had any luck.


What I would like to do is get the value from the currently selected control and also keeping that edited cell to stay as the selected value.



Attachment: DateTimeControl_2620227c.zip

7 Replies 1 reply marked as answer

SG Santhosh Govindasamy Syncfusion Team May 17, 2024 05:13 PM UTC

Hi Adrian Negrillo,

Based on the reported scenario, "when selecting the date value in one cell, changes are reflected in related cells," we are trying to replicate the issue on our end. Your requirement is that the selected value doesn't reflect in related cells and that the selected value is maintained for each cell. We are currently checking the possibility of a workaround. We need time to validate it on our end. We will provide an update on or before May 21, 2024.


Regards,
Santhosh.G



SG Santhosh Govindasamy Syncfusion Team May 21, 2024 04:42 PM UTC

Hi Adrian Negrillo,

We did not have direct support to load the DateTimePicker to the GridGroupingControl. We are currently exploring the possibility of a workaround. We need time to validate it on our end. We will provide an update on or before May 23, 2024.




AN Adrian Negrillo replied to Santhosh Govindasamy May 21, 2024 09:22 PM UTC

Hi Snathosh


Thanks for getting back to me. I'll wait for a possible work around.



SB Sweatha Bharathi Syncfusion Team May 23, 2024 03:42 PM UTC

Hi Adrian Negrillo ,


We regret the inconvenience.

Currently, we are analyzing the cause of the issue. We need time to find the root cause . We will provide further details on May 27, 2024




SB Sweatha Bharathi Syncfusion Team May 27, 2024 02:21 PM UTC

Hi Adrian Negrillo ,


GridGroupingControl supports more than 10 enhanced cell types. These enhanced cell types are listed in the CustomCellTypes enumerator, which can be found in the Syncfusion.GridHelperClasses.Windows library. Without overriding the renderer  , you can use the GridGroupingCellType static method of the RegisterCellModel class to load the DateTimePicker.


We have provided a sample for your reference. Kindly review the sample and let us know if you have any further concerns on this.


Code Snippet:


  public partial class Form1 : Form

  {

      private DateTime Date;

      public Form1()

      {

          InitializeComponent();

       

 

          Products MyProducts = new Products();

          MyProducts.Add(new Product(23, new DateTime(24, 12, 23), "10 boxes x 20 bags"));

          MyProducts.Add(new Product(26, new DateTime(12, 12, 24), "12 - 550 ml bottles"));

          MyProducts.Add(new Product(10, new DateTime(12, 12, 24), "30 gift boxes"));

          MyProducts.Add(new Product(15, new DateTime(12, 12, 24), "10 boxes x 20 bags"));

          MyProducts.Add(new Product(16, new DateTime(12, 12, 24), "12 - 550 ml bottles"));

          MyProducts.Add(new Product(11, new DateTime(12, 12, 24), "30 gift boxes"));

          this.gridGroupingControl1.DataSource = MyProducts;

 

     

          RegisterCellModel.GridGroupingCellType(gridGroupingControl1, CustomCellTypes.DateTimePicker);

 

 

   

      }

  }




UG Link : https://help.syncfusion.com/windowsforms/gridgrouping/celltypes#enhanced-cell-types


Attachment: GridGroupingControl_Demo4_8_ad9fc4b0.zip


AN Adrian Negrillo May 28, 2024 04:17 AM UTC

Hey Sweatha


Thanks for the update! That looks awesome and should work for that column. I'm just wondering now how it could work for a custom control type derived from syncfusions TreeViewAdv as well. So we have a control called OrganisationTreeViewDropDown : TreeViewAdv. 


We have this control on the table as well so I'm just wondering how I can use RegisterCellModel.GridGroupingCellType for this control.


Thanks for the help!



SB Sweatha Bharathi Syncfusion Team May 28, 2024 02:30 PM UTC

Hi Adrian Negrillo ,

We have reviewed your scenario. GridGroupingControl supports more than 10 enhanced cell types. These enhanced cell types are listed in the CustomCellTypes enumerator.


Apart from the built-in and enhanced helper cell types, it is also possible to create a custom cell type in the grid. After creating the Cell Model and Cell Renderer for the custom cell type, it is necessary to register that custom cell type to the GridGroupingControl.


You can refer to the below UG documentation for further reference.


UG Link : https://help.syncfusion.com/windowsforms/gridgrouping/celltypes#creating-a-custom-cell-type



Marked as answer
Loader.
Up arrow icon