Hi,
I am having issues accessing values from a Template Column that I created. Here is what I have.
....
....
<telerik:GridTemplateColumn UniqueName="ItemDiscount" HeaderText="Discount">
<EditItemTemplate>
<asp:RadioButtonList ID="rdListItemDiscount" runat="server">
<asp:ListItem Selected="True">Discount in %</asp:ListItem>
<asp:ListItem>Discount in $</asp:ListItem>
</asp:RadioButtonList>
<telerik:RadNumericTextBox ID="txtItemDiscountVal" runat="server" Width="20px">
</telerik:RadNumericTextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblLineDiscountVal" runat="server" Text="No Discount Applied"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Add Discount"
UpdateText="Update Discount">
<ItemStyle CssClass="MyImageButton" />
</telerik:GridEditCommandColumn>
.....
.....
Code Behind:
Protected Sub rgLineItems_ItemUpdated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles rgLineItems.ItemUpdated
Try
Dim i As Integer = 1
Dim CellValue As String
Dim txtVal As String
CellValue = CType(rgLineItems.Items(i).FindControl("rdListItemDiscount"), RadioButtonList).SelectedItem.Value
txtVal = CType(rgLineItems.Items(i).FindControl("txtItemDiscountVal"), TextBox).Text
Catch ex As Exception
End Try
End Sub
I would like to get the selected value from the radiobuttonlist and the text value upon clicking on Update Discount. Once this is done, I would like to change the EditItemTemplate column to a value entered by the user in the textbox. Let me know where I am going wrong and is this really possible?
Thanks in advance!
Soumya
I am having issues accessing values from a Template Column that I created. Here is what I have.
....
....
<telerik:GridTemplateColumn UniqueName="ItemDiscount" HeaderText="Discount">
<EditItemTemplate>
<asp:RadioButtonList ID="rdListItemDiscount" runat="server">
<asp:ListItem Selected="True">Discount in %</asp:ListItem>
<asp:ListItem>Discount in $</asp:ListItem>
</asp:RadioButtonList>
<telerik:RadNumericTextBox ID="txtItemDiscountVal" runat="server" Width="20px">
</telerik:RadNumericTextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblLineDiscountVal" runat="server" Text="No Discount Applied"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Add Discount"
UpdateText="Update Discount">
<ItemStyle CssClass="MyImageButton" />
</telerik:GridEditCommandColumn>
.....
.....
Code Behind:
Protected Sub rgLineItems_ItemUpdated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles rgLineItems.ItemUpdated
Try
Dim i As Integer = 1
Dim CellValue As String
Dim txtVal As String
CellValue = CType(rgLineItems.Items(i).FindControl("rdListItemDiscount"), RadioButtonList).SelectedItem.Value
txtVal = CType(rgLineItems.Items(i).FindControl("txtItemDiscountVal"), TextBox).Text
Catch ex As Exception
End Try
End Sub
I would like to get the selected value from the radiobuttonlist and the text value upon clicking on Update Discount. Once this is done, I would like to change the EditItemTemplate column to a value entered by the user in the textbox. Let me know where I am going wrong and is this really possible?
Thanks in advance!
Soumya