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

Need to customize the edit functionality

1 Answer 47 Views
This is a migrated thread and some comments may be shown as answers.
Raj J
Top achievements
Rank 1
Raj J asked on 04 May 2010, 03:50 PM

     I am looking to customize the edit functionality. Below is my code for grid.



telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" DataSourceID="SqlDataSource1" OnItemDataBound="RadGrid1_OnItemDataBound" runat="server"



Width="70%" >



<MasterTableView AutoGenerateColumns="False" DataKeyNames="BusinessEntityId" DataSourceID="SqlDataSource1" >






<HeaderStyle Width="20px" />









<HeaderStyle Width="20px" />









<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn" meta:resourcekey="EditColumn">



<HeaderStyle Width="20px" />






<telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="DeleteColumn" CommandName="Delete"



ConfirmText="Are you sure you want delete the selected Officer?" ConfirmDialogType="Classic" ConfirmTitle="Delete Officer?"






<HeaderStyle Width="20px" />






<telerik:GridBoundColumn DataField="BusinessEntityID"



DefaultInsertValue="" HeaderText="BusinessEntityID"



SortExpression="BusinessEntityID" UniqueName="BusinessEntityID">






<telerik:GridBoundColumn DataField="FirstName"



DefaultInsertValue="" HeaderText="FirstName"



SortExpression="FirstName" UniqueName="FirstName">






<telerik:GridBoundColumn DataField="QueueItemNumber" DefaultInsertValue=""



HeaderText="QueueItemNumber" SortExpression="QueueItemNumber"









<telerik:GridBoundColumn DataField="MadePreviousQINumber" DefaultInsertValue=""



HeaderText="MadePreviousQINumber" SortExpression="MadePreviousQINumber"






<telerik:GridCheckBoxColumn UniqueName="IsPrevious"



HeaderText="Previous" DataField="IsPrevious" HeaderStyle-Width="40px" SortExpression="IsPrevious"



DataType="System.Boolean" AllowFiltering="true" />













I am getting the attached screen shot as a result. In the resukt i have 3 types of operation to do based on some criteria. So I am using 3 different images.

If I click on Image 1, need to open a form highlighted in black where i can do update and cancel

If i click on the image 2 i dont want to open the form (highlighted in black) instead i have a raise a even/method to do some operations (Updating some data with out opening form).

Image 3 also works same as image 2.

So Now how to add custom menthod to the click with out opening the form highlighed in red in the attachemnt.

Thanks for you help


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 10 May 2010, 08:38 AM
Hello Raj,

The easiest way to achieve this scenario is to:

 1. Use a GridTemplateColumn and place the corresponding image button in it

2. Set its CommandName property to a custom command name. For example, the first image button may have CommandName="CustomOpertion1", the second CommandName="CustomOperation2".

3. Attach an event handler to the ItemCommand event of the grid.

4. Check the incoming event arguments object for the CommandName that has been intercepted and do you custom application logic as per your requirements.

Hope it helps.

the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Asked by
Raj J
Top achievements
Rank 1
Answers by
Telerik team
Share this question