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

retrieve value/s from textbox using GridClientSelectColumn client-side

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas Derenthal
Top achievements
Rank 1
Thomas Derenthal asked on 22 Oct 2014, 11:51 PM
I have a grid with a textbox and a ClientSelectColumn. I would like to copy the value from one column into the textbox in an itemTemplate column when the selectcolum checkbox is checked. I would like to do this client-side as posting back and using server-side code can take as much as 2 seconds - unacceptable for high-volume data entry.

I would also like to do this for all columns when the checkbox in the header is checked.

TotalAmt would be copied into AmtApproved. I also need to be able to deselect and have the value clear if it exists in the textbox.

Thank you in advance for your help!

 <telerik:GridBoundColumn DataField="TotalAmt" DataType="System.Decimal" FilterControlAltText="Filter TotalAmt column" HeaderText="TotalAmt" SortExpression="Total Due" UniqueName="TotalAmt" DataFormatString="{0:F}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="75px" HeaderStyle-Width="75px">
                                </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Amount Approved" UniqueName="AmtApproved" HeaderStyle-Width="55px" ItemStyle-Width="55px" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
                                    <ItemTemplate>
                                        <asp:TextBox ID="AmountApproved" runat="server" Width="55px" OnTextChanged="AmountApproved_TextChanged" AutoPostBack="true" CssClass="numericAlign"></asp:TextBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridClientSelectColumn HeaderText="Pay in Full" UniqueName="ClientSelectColumn">
                                </telerik:GridClientSelectColumn>

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 27 Oct 2014, 01:32 PM
Hi Thomas,

I've created a sample RadGrid web site to demonstrate how you can achieve the requested functionality. Please run the attached application and let me know if it works for you.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Thomas Derenthal
Top achievements
Rank 1
answered on 27 Oct 2014, 01:54 PM
Thank you so very much! This works exactly as I need.
Tags
Grid
Asked by
Thomas Derenthal
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Thomas Derenthal
Top achievements
Rank 1
Share this question
or