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

Show errormessages in caption of editform

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BOS
Top achievements
Rank 1
BOS asked on 08 Jun 2010, 12:09 PM
I'm looking for a way to place errormessages in the caption of the editform (in grid with editmode = popup)

I've tryed this:
protected void Grid1_InsertCommand(object source, GridCommandEventArgs e)     
{     
    string errorMess = "";  
    // followed by a lot of tests on the typed values ...  
   
    if (errorMess != "")     
    {     
        e.Canceled = true;     
        e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = errorMess;     
    }     
}   
 
but I have to click the insert-button twice, before the text showes up in the caption.
Any ideas on how to avoid having to click twice?

Btw. I can't place the errormessages as added literalcontrol to the cancel-button - this is used for some other info :o)

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 11 Jun 2010, 09:19 AM
Hello BOS,

Since you cancel the InsertCommand the grid would not rebind itself and that is why the message does not appear. Have you tried whether rebinding the grid rectifies the problem:

protected void Grid1_InsertCommand(object source, GridCommandEventArgs e)    
{    
    string errorMess = ""
    // followed by a lot of tests on the typed values ... 
    
    if (errorMess != "")    
    {    
        e.Canceled = true;    
        e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = errorMess;
        (source as RadGrid).Rebind(); 
    }    
}


I hope this helps,
Martin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
BOS
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or