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

Setting value in textbox where radgrid editmode=PopUp

3 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aleš
Top achievements
Rank 1
Aleš asked on 10 Aug 2008, 09:01 PM

Hello,

I can't manage to work it out, how to set or get value from popup.

After few hours I finally made it to work in EditMode="InPlace". But it doesn't work EditMode="PopUp".

Can anyone help me?

CODE

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (RadGrid1.MasterTableView.EditMode == GridEditMode.EditForms)  
        {  
            if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)  
            {  
                GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item;  
                (insertItem["ime"].Controls[0] as TextBox).Text = "something";  
            }  
        }  
        else if (RadGrid1.MasterTableView.EditMode == GridEditMode.InPlace)  
        {  
            if (e.Item is GridDataInsertItem && e.Item.OwnerTableView.IsItemInserted)  
            {  
                GridDataInsertItem insertItem = (GridDataInsertItem)e.Item;  
                (insertItem["ime"].Controls[0] as TextBox).Text = "something";  
            }  
        }  
        else if (RadGrid1.MasterTableView.EditMode == GridEditMode.PopUp)  
        {  
            if (e.Item is GridDataInsertItem && e.Item.OwnerTableView.IsItemInserted)  
            {  
                GridDataInsertItem insertItem = (GridDataInsertItem)e.Item;  
                (insertItem["ime"].Controls[0] as TextBox).Text = "something";  
            }  
        }          
    }  

Thanks

3 Answers, 1 is accepted

Sort by
0
Aleš
Top achievements
Rank 1
answered on 11 Aug 2008, 07:26 AM
Hi,

If you don't understand what I asked please tell me, so I can write my question again.

Thanks
0
Vlad
Telerik team
answered on 11 Aug 2008, 07:38 AM
Hello Aleš,

Here is an example how to achieve this:

            if (RadGrid1.MasterTableView.EditMode == GridEditMode.PopUp)
            {
                if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
                {
                    GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item;
                    (insertItem["ProductName"].Controls[0] as TextBox).Text = "something";
                }
            }

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Aleš
Top achievements
Rank 1
answered on 11 Aug 2008, 07:51 AM
Thank you very much. It worked.
Tags
Grid
Asked by
Aleš
Top achievements
Rank 1
Answers by
Aleš
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or