Hi
I have a DetailTable where I have a CheckBox and also a RadNumericTextBox, when the CheckBox is clicked, and when the RadNumericTextBox is edited, I want to change the last Total column. I can not see how to reference and FindControl those controls.
| <DetailTables> |
| <telerik:GridTableView width="100%" DataKeyNames="ItemId,CampaignId,StockOptionId" Name="Stock" GridLines="None" skinid="Default"> |
| <Columns> |
| <telerik:gridtemplatecolumn headertext="Select" UniqueName="Select"> |
| <ItemTemplate> |
| <asp:CheckBox id="CheckBox1" runat="server" OnCheckedChanged="Add_CheckBox1_CheckChanged" autopostback="true" /> |
| </ItemTemplate> |
| </telerik:gridtemplatecolumn> |
| <telerik:gridtemplatecolumn headertext="Campaign"> |
| <ItemTemplate> |
| <asp:Label ID="Add_lblCampaign" runat="server" Text='<%# Eval("Campaign") %>' /> |
| </ItemTemplate> |
| </telerik:gridtemplatecolumn> |
| <telerik:GridTemplateColumn HeaderText="Avail"> |
| <ItemTemplate> |
| <asp:Label ID="Add_lblAvail" runat="server" Text='<%# String.Format("{0:n}", Eval("Avail")).Replace(".00", "") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Units Text"> |
| <ItemTemplate> |
| <asp:Label ID="lblUnitsTextLabel" runat="server" Text='<%# Eval("UnitsText") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Units Qty"> |
| <ItemStyle Width="90px" /> |
| <ItemTemplate> |
| <telerik:RadNumericTextBox ID="Add_tbUnitsQty" Enabled="false" AutoPostBack="true" OnTextChanged="Add_tbUnitsQty_TextChanged" |
| ShowSpinButtons="True" Width="80px" Type="Number" runat="server" Culture="en-AU" InvalidStyleDuration="100" MinValue="1"> |
| <NumberFormat DecimalDigits="0" /> |
| </telerik:RadNumericTextBox> |
| <asp:RequiredFieldValidator ID="Add_rfvUnitsQty" runat="server" Enabled="false" ControlToValidate="Add_tbUnitsQty" ErrorMessage="Required" Display="Dynamic" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Total"> |
| <ItemTemplate> |
| <asp:label id="Add_lblTotal" runat="server" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </telerik:GridTableView> |
| </DetailTables> |
| protected void Add_CheckBox1_CheckChanged(object sender, EventArgs e) |
| { |
| // How can I get the DataKeyNames, and the RadNumericTextBox, so I can calculate the Total |
| } |
Also, some rows will have 1 to 5 additional rows in the detail table. Say a DetailTable has 5 rows but only 2 are checked with a number in the RadNumericTextBox, how can I iterate all the rows in the DetailTables that are checked and get the DataKey names and value of RadNumericTextBox etc?
Thanks.