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

'Item Command' from Radgrid Does not work

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hugo
Top achievements
Rank 1
hugo asked on 03 Jan 2012, 12:43 AM

Hi every body
I'm currently working with control RadGrid, my module I have 4 RadGrid, one of them has hierarchy, and when I want to work with the last RadGrid Control, it does not work, because when I press a icon from a column that  call a itemcommand event don't work it, don't make anything, i have the next code:

<telerik:RadGrid ID="grdInvitacionPos" runat="server" Skin="Windows7"
AutoGenerateColumns="False" Width="700px"
OnItemCommand="grdInvitacionPos_ItemComm">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkEnviar" runat="server" CausesValidation="false" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Compania"
HeaderStyle-HorizontalAlign="Center" HeaderText="CompaƱia">
<HeaderStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Nombre"
HeaderStyle-HorizontalAlign="Center" HeaderText="Nombre">
<HeaderStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="TipodeParticipante"
HeaderStyle-HorizontalAlign="Center" HeaderText="Tipo de Participante">
<HeaderStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Editar Correo">
<ItemTemplate>
<asp:ImageButton ID="send" runat="server" CommandName="Enviar" CausesValidation="false"
ImageUrl="~/images/DOER_IMAGES/delete.gif" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
</telerik:RadGrid>




protected void grdInvitacionPos_ItemComm(object sender, GridCommandEventArgs e)
        {            
            GlobalNotify.Text = "item command";
            GlobalNotify.Show();
        }

I hope you can help me

Thak you for your attention

Good Day

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Jan 2012, 05:44 AM
Hello Hugo,

ItemCommand event occurs when a button is clicked in a Telerik RadGrid control. You can check for the CommandName as shown below.
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
   if (e.CommandName == "Enviar")
   { //code here
   }
}

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