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
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
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
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?
I am having the same problem losing the value of the DataItem. Any Ideas?
0
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
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.