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

Handling client-side cell updates in RadGrid

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 2
Keith asked on 29 Jun 2012, 04:16 AM
I am very new to telerik controls so please bear with me.
I have a radgrid with multiple template columns. In most of them I have checkboxes and in one I have a textbox. What I need to do is allow the user to edit the textbox value or checkbox checked state and have it reflected in the underlying data.
 
I guess the real question is are these controls databound to the underlying data automatically? If not, what is the best way to manage that?

When the data is bound to the grid, the checkbox state is set via the ItemDataBound event. I'd prefer to allow the user the ability to edit the data as needed and then post it back all at once. Is this possible?

On a different note, I would also like to not have a textbox in the cell but instead cause it to be directly editable when clicking in the cell. Maybe display a temporary textbox that updates the underlying data ... barring that, perhaps format the textbox so it does not appear as an editable cell unless clicked in.

Like I said, I am new to telerik controls so please be patient with me. I am open to all suggestions.

Thanks

1 Answer, 1 is accepted

Sort by
0
Keith
Top achievements
Rank 2
answered on 29 Jun 2012, 07:23 PM
Ok, I managed to resolve my issues with both the binding and the look. This is an example of the solution. I'll not bore everyone with the javascript. The checkbox is similar in nature.

<telerik:GridTemplateColumn AllowFiltering="false"
DataField="ContactName" HeaderText="Contact" UniqueName="colContact">
    <ItemTemplate>
    <asp:TextBox ID="txtContact" Text='<%# Bind("ContactName") %>' ForeColor="#d7d7d7" BackColor="Transparent" BorderStyle="None" runat="server" />

      </
ItemTemplate>
</telerik:GridTemplateColumn>
Tags
Grid
Asked by
Keith
Top achievements
Rank 2
Answers by
Keith
Top achievements
Rank 2
Share this question
or