Hello,
In template column InstantiateIn method I add some control and assign a handler for its DataBinding event. Next, I fire grid edit and update commands from client side. On server side, when ItemCommand event fires, I try to set e.Canceled to false depending on some conditions. But right after that all editor controls become empty. Their DataBind event never fired. What can I do about that?
Thank you.
In template column InstantiateIn method I add some control and assign a handler for its DataBinding event. Next, I fire grid edit and update commands from client side. On server side, when ItemCommand event fires, I try to set e.Canceled to false depending on some conditions. But right after that all editor controls become empty. Their DataBind event never fired. What can I do about that?
Thank you.
5 Answers, 1 is accepted
0

Dmitry
Top achievements
Rank 1
answered on 15 Sep 2011, 09:46 AM
Anyone?
0
Hi Dmitry,
By default the edit command implicitly invokes rebind. However when you cancel the command this does not happen. So you should probably call Rebind() for the grid explicitly.
Best wishes,
Iana Tsolova
the Telerik team
By default the edit command implicitly invokes rebind. However when you cancel the command this does not happen. So you should probably call Rebind() for the grid explicitly.
Best wishes,
Iana Tsolova
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
0

Dmitry
Top achievements
Rank 1
answered on 16 Sep 2011, 11:19 AM
Thank you for advice, it helped. But after Rebind() all controls restored data they have had before, and I need them to show those incorrect data I have entered.
0

Jayesh Goyani
Top achievements
Rank 2
answered on 16 Sep 2011, 12:50 PM
Hello Dmitry,
you can access those controls in itemdatabound.
If this is not your case then elaborate your scenario.
let me know if any concern.
Thanks,
Jayesh Goyani
you can access those controls in itemdatabound.
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = (GridEditableItem)e.Item;
// you can get your control
TextBox TextBox1 = item.FindControl(
"TextBox1"
)
as
TextBox;
// access your control
}
}
If this is not your case then elaborate your scenario.
let me know if any concern.
Thanks,
Jayesh Goyani
0

Dmitry
Top achievements
Rank 1
answered on 16 Sep 2011, 12:58 PM
Well, I didn't think about it :) Thank you very much.