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
30
UltraControlContainerEditor - Using DatePicker for each cell in grid to set mindate and maxdate
posted

Hi,

I am using UltraControlContainerEditor to solve my purpose to set MinDate and MaxDate for each cell depending on some Business Rule.

UltraControlContainerEditor ucce = new UltraControlContainerEditor();
X.DateTimePicker dtEditor1 = new X.DateTimePicker();
ucce.EditingControl = dtEditor1;
ucce.EditingControlPropertyName = "Value";
X.DateTimePicker dtEditor2 = new X.DateTimePicker();
ucce.RenderingControl = dtEditor2;
ucce.RenderingControlPropertyName = "Value";
dgDriveRouteRows.DisplayLayout.Bands[0].Columns["StartDate"].EditorComponent = ucce;

private void SetMinMaxRelationDates(UltraGridCell cell)
{
var cellEditor = (cell.EditorComponentResolved as Infragistics.Win.UltraWinEditors.UltraControlContainerEditor).EditingControl as X.DateTimePicker;

var cellRender = (cell.EditorComponentResolved as Infragistics.Win.UltraWinEditors.UltraControlContainerEditor).RenderingControl as
X.DateTimePicker;
DateTime minRelationDate = GetMinFSDSRelationDate(Id);
if (minRelationDate != default(DateTime))
{
cellEditor.MinDate = minRelationDate;
cellRender.MinDate = minRelationDate;
}

}

Above code is setting Mindate but still I can see all dates and select any date in my datepicker control. Can you please identify the issue and suggest some way?

Thanks,

Nishant Kainth