 |
| ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 8th, 2008, 12:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
You're absolutely right! I was stopping the debug too early and the MemberManager is getting called again (not entirely sure why - other than I'm sure with timing and the way the ODS is set up, it's calling it's own databind after the dates have been set up - probably exactly what you just said in fewer words).
So--how can I tie into an event that I know will be called after the databinding has occured? What event would I want to call to refresh the calendar with the dates?
Thanks,
Rob
(added later - or I can leave it with what is working - by leaving as below--but not sure why that is working now and thoroughly confused)
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Dim selectedDate As Date
selectedDate = Calendar1.SelectedDate
Dim month As Integer = selectedDate.Month
Dim year As Integer = selectedDate.Year
RefreshCalendar(Calendar1, month, year)
ObjectDataSource1.SelectParameters.Clear()
ObjectDataSource1.SelectParameters.Add("myDate", selectedDate.ToString)
End Sub
|
|

July 8th, 2008, 12:44 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Exactly. By calling DataBind, you force the databinding mechanism. However that doesn't stop the framework from doing its normal thing: get your data based on the selected date in the calendar.
What about handing OnSelected on the ODS or OnDataBound on the GridView?
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|
|

July 8th, 2008, 02:59 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Imar,
Thank you - I will try that as soon as I get home---can you help out with one of the first questions I actually had in this thread - what is the syntax for programatically setting a parameter in the objectdatasource?
I know it's not objectDataSourc1.SelectParameters.Add - as the "Add" will add to the collection.
Thanks,
Rob
|
|

July 9th, 2008, 01:44 AM
|
|
Registered User
|
|
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Valuable resources
Chandan
Imfinity India Pvt. Ltd.
|
|
 |