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

Change entire row from button click?

1 Answer 15 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 30 Nov 2011, 04:18 PM
Hello, 

    I trying to accomplish the task of allowing in-line editing for an entire row based off a button click. Basically, I have started implementing a grid that changes style/state of a particular cell if the user selects that given cell. For example, the code below illustrates a text box that changes to become editable if the user clicks the cell. It switches between the CellTemplate and CellEditTemplate. However, I have multiple columns and want ALL the cells in a given row to become editable based off a button click. I was wondering what the best way of doing this was... For the user to click a button in a row, and for that specific row to then become entirely editable. Take a look, thanks!



<telerik:RadGridView.Columns>
               <telerik:GridViewDataColumn
                               Header="Employee"
                               EditTriggers="CellClick">
                   <telerik:GridViewDataColumn.CellTemplate>
                       <DataTemplate>
                           <TextBlock
                              Text="{Binding Name}"/>
                       </DataTemplate>
                   </telerik:GridViewDataColumn.CellTemplate>
                   <telerik:GridViewDataColumn.CellEditTemplate>
                       <DataTemplate>
                           <TextBox
                       Text="{Binding Name}"
                       Margin="20,-1,10,2"/>
                       </DataTemplate>
                   </telerik:GridViewDataColumn.CellEditTemplate>
               </telerik:GridViewDataColumn>

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 05 Dec 2011, 05:37 PM
Hi Jeff,

Would you please shed some more light on your scenario? What do you mean by mentioning: "...for that specific row to then become entirely editable."? However, I have prepared an example project for you that illustrates a possible approach for editing a row based on a button click. Alternatively you might try using the RadGridViewCommands.BeginEdit command, but as it does not support passing a specific data item as a parameter, it would be much more appropriate when used on a button that is outside the RadGridView.

Greetings,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
GridView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or