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

[Solved] Minor formatting problem in Edit template popup

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 28 Feb 2013, 08:03 PM
(I'll swear I've seen this before....)

I have a RadGrid with header and detail form template popup editing.

In the ItemDataBound event, in the edit mode detail section I have a line to set the CaptionFormatString:

             RadGrid1.MasterTableView.DetailTables[0].EditFormSettings.CaptionFormatString = "Edit Detail Id " +  editableItem.GetDataKeyValue("DetailId").ToString() + " for Ticket "+ iHeaderId.ToString();

So far as I can tell this is getting hit every time I edit a detail.

However the first time I'm in the screen and the first time I try to edit a detail record, the popup caption goes to whatever's set in the Aspx rather than what's set in code.  The rest of the time the caption displays as desired.
            

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Mar 2013, 07:31 AM
Hi,

Please try the same in the ItemCommand event as follows.

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.EditCommandName && e.Item.OwnerTableView.Name == "Detail")
    {
        GridEditableItem editableItem = (GridEditableItem)e.Item;
        RadGrid1.MasterTableView.DetailTables[0].EditFormSettings.CaptionFormatString = "Edit Detail Id " + editableItem.GetDataKeyValue("DetailId").ToString() + " for Ticket " + iHeaderId.ToString();
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Boris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or