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

Need to customize the edit functionality

1 Answer 47 Views
Grid
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
Hi.

     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" >

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

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

 

 

<HeaderStyle Width="20px" />

 

 

</telerik:GridEditCommandColumn>

 

 

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

 

 

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

 

 

meta:resourcekey="DeleteColumn">

 

 

<HeaderStyle Width="20px" />

 

 

</telerik:GridButtonColumn>

 

 

<telerik:GridBoundColumn DataField="BusinessEntityID"

 

 

DefaultInsertValue="" HeaderText="BusinessEntityID"

 

 

SortExpression="BusinessEntityID" UniqueName="BusinessEntityID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FirstName"

 

 

DefaultInsertValue="" HeaderText="FirstName"

 

 

SortExpression="FirstName" UniqueName="FirstName">

 

 

</telerik:GridBoundColumn>

 

 

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

 

 

HeaderText="QueueItemNumber" SortExpression="QueueItemNumber"

 

 

UniqueName="QueueItemNumber">

 

 

</telerik:GridBoundColumn>

 

 

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

 

 

HeaderText="MadePreviousQINumber" SortExpression="MadePreviousQINumber"

 

 

UniqueName="MadePreviousQINumber"></telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn UniqueName="IsPrevious"

 

 

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

 

 

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

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 


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

Raji

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
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.

Greetings,
Tsvetoslav
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.
Tags
Grid
Asked by
Raj J
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or