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

Passing info to EditForm

3 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fabrizio
Top achievements
Rank 1
Fabrizio asked on 01 Dec 2015, 05:15 PM

Hello, i'm new to this forum..

I have a question: I would like to know how pass data to EditForm.ascx during itemcommand event?

in the code below you can see what i'm trying to do

 

if (e.CommandName == RadGrid.InitInsertCommandName)
        {
            e.Canceled = true;
            GridKASKO.EditIndexes.Clear();

            e.Item.OwnerTableView.EditFormSettings.UserControlName = "~mypath\\InsertTax.ascx";
            // I WANT TO PASS a VALUE INTO InsertTax.ascx
            e.Item.OwnerTableView.InsertItem();
        }
        else if (e.CommandName == RadGrid.EditCommandName)
        {
            e.Item.OwnerTableView.IsItemInserted = false;
            e.Item.OwnerTableView.EditFormSettings.UserControlName =  "~mypath\\EditTax.ascx";
        }

Thanks in advance,

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Dec 2015, 09:31 AM
Hello Fabrizio,

You can examine the following live sample:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx

For your convenience, I am sending a runnable isolated version of the demo.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Perry
Top achievements
Rank 1
answered on 03 Dec 2015, 06:06 PM

Hey Frabrizio I am doing something similar but I call another web page and pass a variable I set it up with this code in the ASPX code:

<telerik:GridBoundColumn DataField="LinkAnalysisId" HeaderText="Link ID" ReadOnly="true"
                        ForceExtractValue="Always" ConvertEmptyStringToNull="true" Display="true" />
                        <telerik:GridHyperLinkColumn FilterControlAltText ="Filter LinkID2 column"
                           Uniquename="LinklId2" DataNavigateUrlFormatString ="/SubjectList2.aspx?LinkID={0}"
                            DataTextField="LinkAnalysisName" HeaderText="Link Analysis Name"
                            DataNavigateUrlFields="LinkAnalysisId"  />

0
Eyup
Telerik team
answered on 08 Dec 2015, 06:01 AM
Hello Perry,

Thank you for sharing your approach with our community. I hope it will prove helpful to other developers as well.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Fabrizio
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Perry
Top achievements
Rank 1
Share this question
or