I'm trying to databind a datatables DATETIME column to the X-Axis Labels from code behind but I keeping getting this error.
Unable to cast object of type 'System.DateTime' to type 'System.String'.
From the DATETIME, I only want to use the month and year. Any ideas. Thanks in advance
You cannot assign a DateTime to the X-Axis since the axis of a RadChart can only take values of the type double. However, using the ToOADate() function you can convert your DateTimes to doubles. Also note that you will have to set your range from a start date to and end date using the same function in order for the RadChart to be able to display your data. Look at the following Numerical Axis demo.
You can set a label, however, you still need some form of numerical representation of the data and if that data is outside of the range of your x-axis everything might come up skewed. This example shows how to set the labels programmatically and then you just have to capture the event (don't remember it off the top of my head and can't find it right now). You could do RadChart1_PreRender(object sender, EventArgs e) which lets you fool around with the RadChart right before the image is rendered.