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

objectdatasource edit on click

2 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 Jun 2009, 03:55 PM
i have a grid that is populated by ObjectDataSource like this:

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"   
            SelectMethod="GetOrderLinesFromDB"   
            TypeName="Haworth.Opus.Lynx.BOManager.OrderLineManager">  
            <SelectParameters> 
                <asp:Parameter Name="lynxOrderId" Type="String" DefaultValue="1001" /> 
            </SelectParameters> 
        </asp:ObjectDataSource> 
I would like to expand the grid and open the edit form with a click on the row.  In this scenario, how would I go about that?

2 Answers, 1 is accepted

Sort by
0
BaiH
Top achievements
Rank 1
answered on 30 Jun 2009, 06:01 PM
I'm not totaly sure what exactly is the scenario you are implementing, but  you may look at this online example of how to enter edit mode on row  double click.

--BH
0
Shinu
Top achievements
Rank 1
answered on 01 Jul 2009, 06:47 AM
Hi Chris,

Set the EnablePostBackOnRowClick property of the Grid to true and try the following code snippet in the ItemCommand event to achieve the desired scenario.

CS:
 
   protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
       
        if (e.CommandName == "RowClick"
        { 
            e.Item.Expanded = !e.Item.Expanded; 
            e.Item.Edit = !e.Item.Edit; 
 
        } 
   } 


Thanks
Shinu
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
BaiH
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or