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

How to change pop-up edit form caption ?

1 Answer 181 Views
Grid
This is a migrated thread and some comments may be shown as answers.
tomekm
Top achievements
Rank 1
tomekm asked on 26 May 2010, 10:39 PM

My grid is databound to List<Entity>

Edit mode is:

 EditMode="PopUp" 

EditForm is template:

<EditFormSettings EditFormType="Template" ... />

I want to customize pop-up caption that it will say 'You are editing item {number}'.

I cannot use CaptionFormatString because {number} is not my Entity property. It is just subsequent number and it can be DataItem.ItemIndex as well.

I may set it declaratively or in code-behind but how to extract DataItem.ItemIndex of editing row?

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 May 2010, 05:20 AM
Hello Rychu,

This is the code for setting the CaptionFormatString for edit form from code behind.

C#:
 
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    {   
       if (e.CommandName == "Edit"
        { 
           GridDataItem item = (GridDataItem)e.Item; 
           int index =item.ItemIndex+1; 
           RadGrid1.MasterTableView.EditFormSettings.CaptionFormatString = "You are editing item  " + index; 
        } 
     } 

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