Jump to content
Xtreme .Net Talk

cdotnet

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by cdotnet

  1. Month Calendar update solution and SelectionRange is rubbish hi, the solution is to tell the control to refresh itself, this is not done automatically as i guess it would flicker. try: monthCalendarName.UpdateBoldedDates(); another problem with calendar is detailed here you may come across it: my .net remoting application client winform needs to select and highlight dates, to get to these dates once highlighted we can use SelectionRange but we cannot simply do a monthCalendar.AddBoldedDate(monthCalendar.SelectionRange) which would be great, it seems obfuscated and less than useful considering the implementation it could have been (as above.) Here was my solution, its commented so i wont repleat myself. Hope this helps all confused by the SelectionRange ! c. //get start of selection DateTime startDate = monthCalendarMain.SelectionStart.Date; //get end of selection DateTime endDate = monthCalendarMain.SelectionEnd.Date; //timespan calculated from end date minus start date TimeSpan timeSpan = endDate.Subtract(startDate); //create a dateTime array to hold our new dates for bolding DateTime [] selectedDates = new DateTime [timeSpan.Days + 1]; //loop for how ever many dates there are in calendar selection for (int index = 0; index < selectedDates.Length; index++) { //for each one set it to bold, this preserves the existing selections. monthCalendarMain.AddBoldedDate(startDate.AddDays(Convert.ToDouble(index))); } //show user the changes monthCalendarMain.UpdateBoldedDates(); -------------------------------- From: craig soens-hughes
  2. hi, //try a complete wipe out from basics in this order, special !! dataGrid.DataSource=null; dataGrid.DataBindings.Clear(); dataGrid.TableStyles.Clear(); datagridtablestype=null;//if any references exist DataSet=null;// set the main datagrid to null this worked for me when nothing else did here in this post, cheers, craig soens-hughes dotnet put-an-@-here orange.net
×
×
  • Create New...