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

[Solved] Edit form (popup) from server side

5 Answers 388 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 01 Feb 2010, 10:59 AM
Hi,
where can I found a sample of building edit form (popup) for grid in c# (server side) (no in html).

I have a question about popup edit form yet: is it possible to check datatype of data in column (e.g. datatype) and automatically in popup edit form show radtadepicker instead of textbox (all in server side code)?
Thanks.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Feb 2010, 01:04 PM
Hello,

Checkout the following forum link which discusses similar scenario:
Customize the editor depending on the data type
Access the item as GridEditFormItem in ItemDataBound event and follow the suggestion in the forum for adding controls.

Also go through the demo for Window Editing and see whether it meets your requirement of customizing the edit form.

Thanks,
Princy.
0
wnl
Top achievements
Rank 1
answered on 01 Feb 2010, 02:18 PM
Ok, but how can I check a datatype of columns in ItemDataBound? '
And when I make:
 editeditem["ValueCol"].Controls.Clear();   
my automatically update/insert doesn't work.
0
Yavor
Telerik team
answered on 04 Feb 2010, 11:30 AM
Hi Jaromin,

Can you please supply some additional information on the required functionality?
Are you trying to develop something like cell-editing- i.e. showing the popup, but relating it only to a given cell, rather than the whole row?
Any additional information will help us better address the question at hand.

Kind regards,
Yavor
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
wnl
Top achievements
Rank 1
answered on 05 Feb 2010, 09:58 AM
I made this in different way.
My next question is: how to change values in popup edit form (in edit mode, not insert) before this form will load eg. I have value: "2010/01/01 00:00:00" in edit and I want to change to: "2010/01/01".
0
Shinu
Top achievements
Rank 2
answered on 05 Feb 2010, 11:04 AM
Hello Jaromin,

I suppose you want to format a control value when the grid is in edit mode. Here's an example for the same:
c#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            GridEditableItem item = (GridEditableItem)e.Item; 
            TextBox txtbx = (TextBox)item["DOB"].Controls[0]; 
 
            txtbx.Text = Convert.ToDateTime(txtbx.Text).ToShortDateString();             
        } 
    }  

Thanks
Shinu.
Tags
Grid
Asked by
wnl
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
wnl
Top achievements
Rank 1
Yavor
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or