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

GridClientDeleteColumn and OnItemCommand

3 Answers 197 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pablo Alejandre del Rio
Top achievements
Rank 1
Pablo Alejandre del Rio asked on 19 Jun 2008, 12:09 PM



Hello Telerik :

I am using  a radgrid   and i have a column  of the type : GridClientDeleteColumn . Well when the user click this column  i want to play with the event OnItemCommand . Well when i click that column nothing happens , just this row dissapears , and the event isn't fired. I am using the same struture in other places and it's working, but not here.

But when i sort o change the page  this method is fired, but not when  i click in that column
Do you know what is wrong ?

I show you my code:

<
telerik:RadGrid

ID="_rggroupproducts"

runat="server"

AllowPaging="True"

AutoGenerateColumns="False"

AllowSorting="true"

Width="350px"

GridLines="None"

OnPageIndexChanged="RgGroupProducts_PageIndexChanged1"

OnSortCommand="RgGroupProducts_SortCommand"

OnItemCommand="RgGroupProducts_OnItemCommand"

EnableEmbeddedSkins="false" >

<FooterStyle Height="200px" />

<ClientSettings >

<Selecting AllowRowSelect="true" />

</ClientSettings>

<MasterTableView

DataKeyNames="ProductID"

PageSize="20" >

<SortExpressions>

<telerik:GridSortExpression FieldName="ProductID" SortOrder="Ascending" />

</SortExpressions>

<PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="5" PrevPageImageUrl= "../Web20/Grid/PagingPrev.gif" NextPageImageUrl="../Web20/Grid/PagingNext.gif"

Wrap="False" HorizontalAlign="Left" />

<Columns>

<telerik:GridBoundColumn DataField="ProductID" HeaderText="ID" ReadOnly="True" SortExpression="ProductID"

UniqueName="ProductID" >

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="True" SortExpression="Description"

UniqueName="Description2" >

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="BasePrice" HeaderText="BasePrice" ReadOnly="True" SortExpression="BasePrice"

UniqueName="BasePrice">

</telerik:GridBoundColumn>

<telerik:GridClientDeleteColumn CommandName="Add" Text="Add" ButtonType="ImageButton" ShowSortIcon="true" ImageUrl="../Images/Plus.gif" >

</telerik:GridClientDeleteColumn>

</Columns>

</MasterTableView>

</telerik:RadGrid>

and in the  RgGroupProducts_OnItemCommand Method

if (e.CommandName == "Add")

{}

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Jun 2008, 12:14 PM
Hello Pablo,

Generally GridClientDeleteColumn is designed to delete rows client-side and submit these changes on the first post-back/ajax request. If your scenario is different you can use normal GridButtonColumn with CommandName="Delete".

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Jun 2008, 06:24 AM
Hi Pablo,

You can also refer the following help article.
Deleting records

Shinu.
0
Pablo Alejandre del Rio
Top achievements
Rank 1
answered on 14 Jul 2008, 12:12 PM
Finally it was a problem  in other part of the application .

Anyway, although my way to do it it's working, I notice that
your way to do it is the proper way. 

Thank you.Pablo
Tags
Grid
Asked by
Pablo Alejandre del Rio
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Shinu
Top achievements
Rank 2
Pablo Alejandre del Rio
Top achievements
Rank 1
Share this question
or