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

[Solved] Pop up Edit Form

6 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 13 Jul 2009, 02:03 PM
Is there a way to call the Pop Up Edit From from a button click?

6 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 13 Jul 2009, 03:31 PM
Hello Sean,

Very intuitively, you can put any item in edit mode from outside RadGrid:

RadGrid1.MasterTableView.Items[3].FireCommandEvent("Edit"null); 

The above code places the item with Index 3 in edit mode, and this method can be called from any control and event.

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sean
Top achievements
Rank 1
answered on 13 Jul 2009, 03:43 PM
I dont want to put a specific item in edit mode id like to open the entire EditForm.ascx
0
Veli
Telerik team
answered on 14 Jul 2009, 06:33 AM
Hello Sean,

I thing we are referring to one and the same thing. Check it out.

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sean
Top achievements
Rank 1
answered on 14 Jul 2009, 04:13 PM
Thank you, that worked. Now is there anyway to set the text of a textbox in the edit form? Currently i have the textbox bound to a field, can i add a carriage return before the text. something like textbox1.text = vbcrlf & textbox.text when the form loads
0
Princy
Top achievements
Rank 2
answered on 15 Jul 2009, 05:33 AM
Hello Sean,

You can try out the following code to customize the text of a textbox in the UserControl EditForm:
aspx.cs:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
        {  
            string vbcrlf = "value"//pass the carriage return here 
            GridEditableItem editItem = (GridEditableItem)e.Item;  
            UserControl user = (UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);  
            TextBox txtbx = (TextBox)user.FindControl("TextBox1");  
            txtbx.Text = vbcrlf + txtbx.Text;  
        }  
    }  

Thanks
Princy.
0
Sean
Top achievements
Rank 1
answered on 15 Jul 2009, 07:42 PM
I think its having trouble finding my textbox which is named txtAddress. I keep getting an "

Object reference not set to an instance of an object error

"
Tags
Grid
Asked by
Sean
Top achievements
Rank 1
Answers by
Veli
Telerik team
Sean
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or