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

RadGrid, EditFormSettings

3 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dani
Top achievements
Rank 1
Dani asked on 23 Aug 2012, 12:20 PM
Hi,

I try to edit rows in a RadGrid with EditFormSettings :

<EditFormSettings UserControlName="Controles/ManteminientoGridFacturasGastos.ascx" EditFormType="WebUserControl">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>


When i invoke the click event from the button insert on ManteminientoGridFacturasGastos.ascx i'm not able to capture this event on the RadGrid.
<td>
                        <telerik:RadButton ID="cBtnInsertar" runat="server" Text="Insertar" CommandName="Insert" Visible='<%# (DataItem is Telerik.Web.UI.GridInsertionObject) %>' />
                        <telerik:RadButton ID="cBtnModificar" runat="server" Text="Modificar" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>' />
                    </td>
                    <td>
                        <telerik:RadButton ID="cBtnCancelar" runat="server" Text="Cancelar"
                            CausesValidation="false" CommandName="Cancel" onclick="cBtnCancelar_Click" />
                    </td>

For example, when i push the button cBtnInsertar i want to activate the event RadGrid1_InsertCommand on RadGrid but it not invoked.

I need help.

Best regards,

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Aug 2012, 04:39 AM
Hi,

You can use FireCommand to invoke InsertCommand.
C#:
protected void cBtnInsertar_Click(object sender, EventArgs e)
{
 (RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0] as GridCommandItem).FireCommandEvent(RadGrid.PerformInsertCommandName, string.Empty);
}

Thanks,
Shinu.
0
Dani
Top achievements
Rank 1
answered on 24 Aug 2012, 08:13 AM
Thank you for your answer.

I try to add your code example, but i have any problems.

(RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0] as GridCommandItem).FireCommandEvent(RadGrid.PerformInsertCommandName, string.Empty);

The RadGrid1 not is visible from ManteminientoGridFacturasGastos.ascx for edit de grid i use another control. The Default.aspx-RadGrid1 not accessible from control

Best Regards,
0
Andrey
Telerik team
answered on 28 Aug 2012, 08:22 AM
Hello,

Could you elaborate a bit more on your scenario, how many files you have, how they are related to each other, what controls are used, from what page what control do you want to access and where it is located?

Additionally, full page source code could help all the people who want to help you to better understand your case provide more to the point answers.

All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Dani
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dani
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or