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
260
can not access the control in Infragistics.DragDrop event
posted

Hi,

 

I have implemented drag drop functionality in my silverlight page, inside the event I am trying to access the a page control. I am getting object reference error. but any other silver light page events I am able to access the control...code is here..

 

 

 

 

 

 

 

 

 

 

 

 

 

 

private

 

 

 

void DragSource_Drop(object sender, Infragistics.DragDrop.DropEventArgs

e)

{

 

 

 

DatePicker from = this.FindName("fromDatePicker") as DatePicker

; // here the from is NULL

 

 

DatePicker to = this.FindName("toDatePicker") as DatePicker

;

 

 

 

Border dropTarget = e.DropTarget as Border

;

 

 

 

Image originalDragSource = e.OriginalDragSource as Image

;

 

 

 

string

tag = originalDragSource.Tag.ToString();

 

 

 

WeatherContext context = new WeatherContext

();

context.Load<

 

 

RPT_1HOUR

>(context.GetWeatherInfoQuery(from.SelectedDate.Value, to.SelectedDate.Value));

 

 

 

Series series = new Series

();

series.Label =

 

 

"Test Label"

;

series.ChartType =

 

 

ChartType

.Line;

series.DataPointColor =

 

 

DataPointColor

.Different;

series.DataMapping =

 

 

"Label=DATAPOINT;Value="

+tag;

series.DataSource = context.RPT_1HOURs;

 

 

 

this

.weatherGrid.ItemsSource = context.RPT_1HOURs;

 

 

 

this

.dataChart.Series.Add(series);

Please let me know.

Thanks

-Sajin

 

  • 14517
    Offline posted

    Hello Sajin,

    I realize it has been some time since your post. I looked at the source code you provided and from this I am unable to determine the issue you are having. Unless the fromDatePicker is inside of some other container this scenario should work.  I have tested this in the attached sample and the behavior was as expected: the fromDatePicker was found. If you still need assistance with this matter, please provide me with more information on the layout of your page.

    Sincerely,
    Valerie
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

    SilverlightApplication1.zip