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

Popup Edit Form - Insert Caption

7 Answers 304 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 23 May 2008, 06:42 PM
I see how to use CaptionFormatString and CaptionDataField to edit the caption on the popup edit form.

How do you set the caption when you are doing an insert using the popup edit form?

Thanks,

Paul

7 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 27 May 2008, 07:28 AM
Hi Paul,

Unfortunately, you cannot include this when you are inserting a new item.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Steve
Top achievements
Rank 2
answered on 18 Oct 2008, 02:46 AM
You're saying there's no way to get a handle on the popup caption to set it dynamically?  It's small, but surprising if it's not available.
0
Princy
Top achievements
Rank 2
answered on 20 Oct 2008, 06:01 AM
Hello Steve,

Try out the following code to modify the CaptionFormatString for an Edit/Insert form dynamically.
cs:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == RadGrid.EditCommandName) 
         { 
             e.Item.OwnerTableView.EditFormSettings.CaptionDataField = "Name"
             e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = "Edit Details for {0} Here"
         } 
        else if(e.CommandName==RadGrid.InitInsertCommandName) 
         { 
             //CaptionDataField cannot be set for an InsertForm since its a general form  
             e.Item.OwnerTableView.EditFormSettings.CaptionFormatString = "Insert Details Here"
         } 

Thanks
Princy.
0
Steve
Top achievements
Rank 2
answered on 21 Oct 2008, 03:11 AM
For insert, that does absolutely nothing.  Setting the text on edit is not the problem.
0
MD
Top achievements
Rank 1
answered on 10 Nov 2008, 10:23 PM
Is there a reason why this has not been added?  As it does work, but only after calling the add a second time.
0
Yavor
Telerik team
answered on 11 Nov 2008, 07:06 AM
Hi Matt,

Attached to this message, is a small application, which handles the functionality in question.
I hope it helps.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
MD
Top achievements
Rank 1
answered on 11 Nov 2008, 01:58 PM
That did it, I just needed to rebind the grid.

Thanks
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Steve
Top achievements
Rank 2
Princy
Top achievements
Rank 2
MD
Top achievements
Rank 1
Share this question
or