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

[Solved] _InsertCommand not fired

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ericc34
Top achievements
Rank 1
ericc34 asked on 18 Jun 2008, 06:53 PM
I don't know why _InsertCommand not fired in this grid

<

telerik:RadGrid ID="Grid" runat="server" Skin="Outlook" GridLines="None" EnableAjaxSkinRendering="true">

<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="ID" TableLayout="Fixed">

<CommandItemTemplate>

<asp:LinkButton ID="lnkBtnAddData" runat="server" CommandName="InitInsert" Visible="true"><img style="border:0px;vertical-align:middle;" alt="" src="../images/AddRecord.Gif" />

<asp:Literal ID="litAddData" runat="server" Text="Ajouter une donn‚e"></asp:Literal>

</asp:LinkButton>

</CommandItemTemplate>

<Columns>

<telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Annuler la modification de la donn‚e"

UniqueName="EditCommandColumn" CancelImageUrl="../RadControls/Grid/Skins/Outlook/Cancel.Gif"

FilterImageUrl="" InsertText="Ajouter une donn‚e" InsertImageUrl="../RadControls/Grid/Skins/Outlook/Update.Gif"

SortAscImageUrl="" SortDescImageUrl="" UpdateText="Mettre … jour la donn‚e"

UpdateImageUrl="../RadControls/Grid/Skins/Outlook/Update.Gif" EditText="Modifier la donn‚e"

EditImageUrl="../RadControls/Grid/Skins/Outlook/Edit.Gif">

<HeaderStyle Width="40px" />

<ItemStyle HorizontalAlign="Center" Width="40px"/>

</telerik:GridEditCommandColumn>

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Supprimer la donn‚e" ConfirmText="D‚sirez-vous supprimer cette donn‚e ?" ConfirmDialogType="RadWindow"

UniqueName="DeleteColumn" ImageUrl="../RadControls/Grid/Skins/Outlook/Delete.Gif">

<HeaderStyle Width="20px" />

<ItemStyle HorizontalAlign="Center" />

</telerik:GridButtonColumn>

<telerik:GridBoundColumn DataField="ID" UniqueName="ID" Visible="false">

</telerik:GridBoundColumn>

</Columns>

<NoRecordsTemplate>

<asp:Label ID="lblNoRecordsTemplate" runat="server" Text="Aucun enregistrement"></asp:Label>

</NoRecordsTemplate>

<ItemStyle Font-Names="Tahoma" Font-Size="8pt" />

</MasterTableView>

</

telerik:RadGrid>

Dynamically I add many columns in my grid in load event of my page. I can click add data button but when i try to save my add, InsertCommand don't fired

why

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jun 2008, 06:13 AM
Hi,

Have you set the EventHandler for the ItemCommand event? Try setting it in the aspx and check the CommandName in the ItemCommand event as shown below.

ASPX:
<telerik:radgrid id="RadGrid1" runat="server" OnItemCommand="RadGrid1_ItemCommand" > 

CS:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "InitInsert"
        { 
             
        } 
         
    } 


Thanks
Shinu.
Tags
Grid
Asked by
ericc34
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or