This is a migrated thread and some comments may be shown as answers.

WebUserControl receive null DataItem

4 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hugues
Top achievements
Rank 1
Hugues asked on 30 May 2008, 01:58 PM
We have a RadGrid with an EditFormType of WebUserControl.

The problem is that the DataItem property is set to the correct element only on first selection. If, on save, validation error occurs and the form is redisplayed, the value passed to the DataItem is null.

What can we do wrong? Is there something specific to set to always get the correct element on each "postback"?

Thanks,

Hugues

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jun 2008, 06:39 AM

Hi,

Have you defined the DataItem property in the user control code-behind you are using for edit?

CS:

public object DataItem  
{  
  get  
  {  
    return this._dataItem;  
  }  
  set  
  {  
    this._dataItem = value;  
  }  
}  

Princy.
0
Hugues
Top achievements
Rank 1
answered on 03 Jun 2008, 12:20 PM
Yes, the property is defined exactly as shown.

Hugues
0
AdventurGurl
Top achievements
Rank 1
answered on 05 Feb 2011, 05:24 PM
ping back..
I am having the same problem losing the value of the DataItem.  Any Ideas?
0
Iana Tsolova
Telerik team
answered on 10 Feb 2011, 10:21 AM
Hello AdventurGurl,

Can you share a sample code which we can test? Or elaborate a bit on your scenario. For instance when are you trying to get the DataItem object?

All the best,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Hugues
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Hugues
Top achievements
Rank 1
AdventurGurl
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or