Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
UltraControlContainerEditor RenderingControl retaining the value for new row
posted

Hello Infragistics,

I needed a help regarding to UltraControlContainerEditor.

I am using UltraControlContainerEditor inside UltraGrid to accept a Date value.

I am facing following two issues

  1. If we add multiple rows, say we added 4 rows, then If I change the Date of the 3rd column, then it changes the Date in other rows too, mainly in 4th row. I feel having Renderingcontrol is creating the problem, if I remove the rendering control , then it works fine. But I can't remove it because of my business needs and in real, I am using my own customised date control with specific formatting.

  2. Whenever a new row is added to the Grid, this Date Column carries the value from the previous row. This issue is less important for me though.

 

Please find attached sample application demonstrating this issue.

Kindly let me know on further details.

 

Thanks,

Arjun

InfragisticsTest.zip
Parents
No Data
Reply
  • 21795
    Verified Answer
    Offline posted

    Hello Mallikarjun,

    When you add a new row the value of the StartDate cell in your data table is DBNull and the value of the related grid’s cell is null. When the cell is rendered DateTimePicker is trying to render this null value. As it is not capable of doing so it renders its current value, or if its current value was not set it renders DateTime.Now. So this is expected behavior. What you can do is set the StartDate cell value, e.g. you can set it to DateTime.Now, when a new row is added. One way to achieve this is to handle AfterRowInsert event like this:

    private void UltraGrid1_AfterRowInsert(object sender, RowEventArgs e)
    {
        e.Row.Cells["StartDate"].Value = DateTime.Now;
    }

    Please let me know if you have any additional questions.

Children