Print Page | Close Window

DatePicker .NET compatibility

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8156
Printed Date: 01 February 2025 at 9:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DatePicker .NET compatibility
Posted By: simus
Subject: DatePicker .NET compatibility
Date Posted: 25 September 2007 at 6:13am
Hi,
 
I use the ActiveX DatePicker in C# .NET application.
 
.NET generate the Interop dlls and the DatePicker works fine.
 
The problem I have is regarding the selected blocks of dates.
 
In the Selection object of type DatePickerSelection I do not see the Blocks property. I think it is Interoperability problem of properties with arguments
So I cannot get the selected dates
 
Does anyone have an idea about that? Is there a way to get Selected dates via another entry point?
 
Thanks a lot!



Replies:
Posted By: Oleg
Date Posted: 26 September 2007 at 1:15am
Hi,
 
Think you forgot indexer:
 
private void wndDatePicker_SelectionChanged(object eventSender, System.EventArgs eventArgs)
  {
   System.DateTime DateMin = DateTime.MinValue;
   System.DateTime DateMax = DateTime.MinValue;
   if (wndDatePicker.Selection.BlocksCount == 1)
   {
    DateMin = wndDatePicker.Selection[0].DateBegin;
    DateMax = wndDatePicker.Selection[0].DateEnd;
    if (DateMin == DateMax)
     System.Diagnostics.Debug.WriteLine("SelectionChanged. Date = " + DateMin);
    else
     System.Diagnostics.Debug.WriteLine("SelectionChanged. Min Date = " + DateMin + ", Max Date = " + DateMax);
   }
   else if (wndDatePicker.Selection.BlocksCount > 1)
   {
    DateMin = wndDatePicker.Selection[0].DateBegin;
    DateMax = wndDatePicker.Selection[wndDatePicker.Selection.BlocksCount - 1].DateEnd;
    System.Diagnostics.Debug.WriteLine("SelectionChanged. Total Selected Blocks = " + wndDatePicker.Selection.BlocksCount + ", Min Date = " + DateMin + ", Max Date = " + DateMax);
   }
   else
    System.Diagnostics.Debug.WriteLine("SelectionChanged. No Selection");
  }


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: simus
Date Posted: 26 September 2007 at 3:29am
Ooops, yes indeed.
I was focused on foreach.
 
Thank you



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net