
Shukhrat Nekbaev
Top achievements
Rank 1
Shukhrat Nekbaev
asked on 22 Oct 2010, 09:59 AM
Hi! I'm using latest controls. I have user control loaded dynamically, it has RadGrid, which has DataSourceID set to LLBLGen datasources, automatic operations are enabled. For editing purposes I use:
<EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit Order: {0}" CaptionDataField="CustomerIdPk" PopUpSettings-Modal="true" EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
<FormTemplate>
...
.....
<asp:TextBox ID="txtDescription" runat="server" Width="210px" Text='<%# Bind("Description") %>'></asp:TextBox>
<asp:DropDownList ID="ddlPaymentMethod" DataSourceID="odsPaymentMethod" SelectedValue='<%# Bind("PaymentMethod") %>' runat="server">
</asp:DropDownList>
Problem starts with this:
<asp:CheckBox ID="chkVATApplied" Checked='<%# Bind("VATApplied") %>' runat="server" />
<telerik:RadNumericTextBox ID="txtFinalOrderPrice" runat="server"
DbValue='<%# Bind("FinalOrderPrice") %>' EnabledStyle-HorizontalAlign="Center"
EmptyMessage="Required" MaxValue="100000" MinValue="0"
Width="80px"
Type="Currency">
<NumberFormat AllowRounding="false" />
</telerik:RadNumericTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtFinalOrderPrice" Display="None"
ErrorMessage="Total order price must be defined"> </asp:RequiredFieldValidator>
-------------
When I click update data is saved only from TextBoxes, DropDownList, but not from CheckBox and RadNumericTextBox. I can see that all data was loaded, but not everything is saved. Could you please hint what am I doing wrong, thank you!
<EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit Order: {0}" CaptionDataField="CustomerIdPk" PopUpSettings-Modal="true" EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
<FormTemplate>
...
.....
<asp:TextBox ID="txtDescription" runat="server" Width="210px" Text='<%# Bind("Description") %>'></asp:TextBox>
<asp:DropDownList ID="ddlPaymentMethod" DataSourceID="odsPaymentMethod" SelectedValue='<%# Bind("PaymentMethod") %>' runat="server">
</asp:DropDownList>
Problem starts with this:
<asp:CheckBox ID="chkVATApplied" Checked='<%# Bind("VATApplied") %>' runat="server" />
<telerik:RadNumericTextBox ID="txtFinalOrderPrice" runat="server"
DbValue='<%# Bind("FinalOrderPrice") %>' EnabledStyle-HorizontalAlign="Center"
EmptyMessage="Required" MaxValue="100000" MinValue="0"
Width="80px"
Type="Currency">
<NumberFormat AllowRounding="false" />
</telerik:RadNumericTextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="txtFinalOrderPrice" Display="None"
ErrorMessage="Total order price must be defined"> </asp:RequiredFieldValidator>
-------------
When I click update data is saved only from TextBoxes, DropDownList, but not from CheckBox and RadNumericTextBox. I can see that all data was loaded, but not everything is saved. Could you please hint what am I doing wrong, thank you!
9 Answers, 1 is accepted
0

Shukhrat Nekbaev
Top achievements
Rank 1
answered on 25 Oct 2010, 09:45 AM
Hi, any ideas on that?
0
Hello Shukhrat,
I looked through your code and I cannot see an obvious reason for the described issue.
Please send me the declaration of the data source and the code for the update command,so that I can advise you further.
Sincerely yours,
Mira
the Telerik team
I looked through your code and I cannot see an obvious reason for the described issue.
Please send me the declaration of the data source and the code for the update command,so that I can advise you further.
Sincerely yours,
Mira
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Shukhrat Nekbaev
Top achievements
Rank 1
answered on 01 Nov 2010, 09:48 AM
Hi, thx for reply. This user control is dynamically loaded in main page, here you go:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrdersCustomerBuyerView.ascx.cs" Inherits="XXX.ShopManager.Web.Controls.Sales_views.Orders_Customer_Buyer_View.OrdersCustomerBuyerView" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20"
Namespace="SD.LLBLGen.Pro.ORMSupportClasses" TagPrefix="llblgenpro" %>
<%@ Import Namespace="XXX.BL.Web.Shop" %>
<%@ Import Namespace="XXX.Data.EntityClasses" %>
<%@ Register Assembly="XXX.ShopManager" Namespace="XXX.ShopManager.BL.Web.Controls.Helper" TagPrefix="customTelerik" %>
<
div
id
=
"gvDiv"
style
=
"width:91%"
>
<
telerik:RadGrid
ID
=
"gvOrdersCustomerBuyerView"
runat
=
"server"
DataSourceID
=
"orderDS"
AllowSorting
=
"True"
PageSize
=
"20"
AllowPaging
=
"True"
Height
=
"550px"
SortingSettings-EnableSkinSortStyles
=
"true"
GridLines
=
"None"
Skin
=
"Windows7"
AutoGenerateEditColumn
=
"True"
AllowAutomaticUpdates
=
"true"
AllowFilteringByColumn
=
"True"
OnItemCreated
=
"gvOrdersCustomerBuyerView_ItemCreated"
AllowAutomaticDeletes
=
"true"
OnItemCommand
=
"gvOrdersCustomerBuyerView_ItemCommand"
AutoGenerateColumns
=
"False"
OnUpdateCommand
=
"gvOrdersCustomerBuyerView_UpdateCommand"
ondatabound
=
"gvOrdersCustomerBuyerView_DataBound"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
FrozenColumnsCount
=
"1"
/>
<
Resizing
ResizeGridOnColumnResize
=
"false"
ClipCellContentOnResize
=
"false"
AllowColumnResize
=
"true"
/>
<
ClientEvents
OnPopUpShowing
=
"PopUpShowing"
OnFilterMenuShowing
=
"filterMenuShowing"
/>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
</
ClientSettings
>
<
FilterMenu
OnClientShown
=
"MenuShowing"
/>
<
MasterTableView
DataKeyNames
=
"CustomerIdPk"
DataSourceID
=
"orderDS"
CommandItemDisplay
=
"Top"
Width
=
"99%"
EditMode
=
"PopUp"
HierarchyLoadMode
=
"ServerOnDemand"
GridLines
=
"Both"
BorderColor
=
"Silver"
BorderWidth
=
"1px"
CellPadding
=
"1"
CellSpacing
=
"1"
GroupLoadMode
=
"Server"
>
<
EditFormSettings
InsertCaption
=
"Add new item"
CaptionFormatString
=
"Edit Order: {0}"
CaptionDataField
=
"CustomerIdPk"
PopUpSettings-Modal
=
"true"
EditFormType
=
"Template"
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
></
EditColumn
>
<
FormTemplate
>
<
div
id
=
"InnerContainer"
style
=
"width:100%; text-align:center;"
>
<
div
style
=
"padding: 7px 7px 7px 7px; text-align:left;"
>
<
table
cellpadding
=
"1"
cellspacing
=
"1"
style
=
"text-align:left;"
>
<
tr
>
<
td
style
=
"width: 100px; font-weight: bold;"
>Purchase guid</
td
>
<
td
><%# Eval("PurchaseGuid") %>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>Payment method</
td
>
<
td
>
<
asp:DropDownList
ID
=
"ddlPaymentMethod"
DataSourceID
=
"odsPaymentMethod"
SelectedValue='<%# Bind("PaymentMethod") %>' runat="server">
</
asp:DropDownList
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>Order status</
td
>
<
td
>
<
asp:DropDownList
ID
=
"ddlOrderStatus"
DataSourceID
=
"odsOrderStatus"
SelectedValue='<%# Bind("OrderStatus") %>' runat="server">
</
asp:DropDownList
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>VAT applied</
td
>
<
td
>
<
asp:CheckBox
ID
=
"chkVATApplied"
Checked='<%# Bind("VATApplied") %>' runat="server" />
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>Price (no VAT)</
td
>
<
td
>
<
telerik:RadNumericTextBox
ID
=
"txtPrice"
runat
=
"server"
DbValue='<%# Bind("OrderPriceWithoutVAT") %>' EnabledStyle-HorizontalAlign="Center"
EmptyMessage="Required" MaxValue="100000" MinValue="0"
Width="80px"
Type="Currency">
<
NumberFormat
AllowRounding
=
"false"
/>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ControlToValidate
=
"txtPrice"
Display
=
"None"
ErrorMessage
=
"Price (no VAT) must be defined"
> </
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>Total order price</
td
>
<
td
>
<
telerik:RadNumericTextBox
ID
=
"txtFinalOrderPrice"
runat
=
"server"
DbValue='<%# Bind("FinalOrderPrice") %>' EnabledStyle-HorizontalAlign="Center"
EmptyMessage="Required" MaxValue="100000" MinValue="0"
Width="80px"
Type="Currency">
<
NumberFormat
AllowRounding
=
"false"
/>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator3"
runat
=
"server"
ControlToValidate
=
"txtFinalOrderPrice"
Display
=
"None"
ErrorMessage
=
"Total order price must be defined"
> </
asp:RequiredFieldValidator
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold;"
>Description</
td
>
<
td
>
<
asp:TextBox
ID
=
"txtDescription"
runat
=
"server"
Width
=
"210px"
Text='<%# Bind("Description") %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"left"
colspan
=
"2"
style
=
"padding-top:10px;"
>
<
asp:Button
ID
=
"btnUpdate"
runat
=
"server"
BackColor
=
"#FFFBFF"
BorderColor
=
"#CCCCCC"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
Font-Names="Verdana" Font-Size="12px" ForeColor="#284775" />
<
asp:Button
ID
=
"btnCancel"
BackColor
=
"#FFFBFF"
BorderColor
=
"#CCCCCC"
Font-Names
=
"Verdana"
Font-Size
=
"12px"
ForeColor
=
"#284775"
BorderStyle
=
"Solid"
BorderWidth
=
"1px"
Text
=
"Cancel"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
></
asp:Button
></
td
>
</
tr
>
</
table
>
<
asp:ValidationSummary
ID
=
"ValidationSummary1"
runat
=
"server"
/>
</
div
>
</
div
>
<
img
src
=
"/images/stubImg.gif"
style
=
"display:none"
alt
=
""
onload
=
"javascript:updateHeight();"
/>
</
FormTemplate
>
</
EditFormSettings
>
<
CommandItemTemplate
>
<
div
style
=
"padding: 6px;"
>
<
asp:CheckBox
ID
=
"chkEnableMultiSort"
runat
=
"server"
Text
=
"Enable multi-column sorting"
Font-Bold
=
"true"
AutoPostBack
=
"true"
oncheckedchanged
=
"chkEnableMultiSort_CheckedChanged"
/> |
<
asp:LinkButton
ID
=
"btnClearFilter"
runat
=
"server"
Text
=
"Clear filter"
Font-Bold
=
"true"
onclick
=
"btnClearFilter_Click"
/> |
<
asp:LinkButton
ID
=
"LinkButton4"
runat
=
"server"
Font-Bold
=
"true"
CommandName
=
"RebindGrid"
><%--<
img
style
=
"border:0px;vertical-align:middle;"
alt
=
""
src
=
"Images/Refresh.gif"
/>--%>Refresh list</
asp:LinkButton
>
</
div
>
</
CommandItemTemplate
>
<
NestedViewSettings
DataSourceID
=
"customerDS"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"Id"
MasterKeyField
=
"CustomerIdPk"
/>
</
ParentTableRelation
>
</
NestedViewSettings
>
<
NestedViewTemplate
>
<
div
id
=
"InnerContainerView"
style
=
"width:500px; border:2px solid silver;"
>
<
div
style
=
"padding: 7px 7px 7px 7px;"
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"tabStipDetails"
MultiPageID
=
"Multipage1"
SelectedIndex
=
"0"
OnClientTabSelected
=
"onTabSelected"
Skin
=
"Windows7"
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Customer"
PageViewID
=
"PageView1"
>
</
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Buyer"
PageViewID
=
"PageView2"
>
</
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Order details"
PageViewID
=
"PageView3"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"Multipage1"
SelectedIndex
=
"0"
RenderSelectedPageOnly
=
"false"
ForeColor
=
"#4A4A4A"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"PageView1"
BorderStyle
=
"Solid"
BorderColor
=
"Silver"
BorderWidth
=
"1"
>
<
div
style
=
"padding: 5px 5px 5px 5px;"
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
>
<
tr
>
<
td
style
=
"width:170px;font-weight:bold;"
>Company name</
td
>
<
td
><%# Eval("CompanyName")%></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Corporate Id</
td
>
<
td
><%# Eval("CorporateId")%></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Full name</
td
>
<
td
><%# string.Format("{0} {1}", Eval("Firstname"), Eval("Lastname")) %></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Email</
td
>
<
td
style
=
"color:#000"
><
a
href
=
"mailto:<%# Eval("
Email")%>" style="color:#1e3287"><%# Eval("Email")%></
a
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Phone</
td
>
<
td
><%# Eval("Phone")%></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold; vertical-align:top;"
>Address</
td
>
<
td
><%# Eval("StreetAddress")%>, <%# string.Format("{0} {1}", Eval("PostalCode"), Eval("City")) %>, <%# Eval("Country") %></
td
>
</
tr
>
</
table
>
</
div
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"PageView2"
BorderStyle
=
"Solid"
BorderColor
=
"Silver"
BorderWidth
=
"1"
>
<
div
style
=
"padding: 5px 5px 5px 5px;"
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
>
<
tr
>
<
td
style
=
"width:170px;font-weight:bold;"
>Company name</
td
>
<
td
><%# ((CustomerEntity) Container.DataItem).Buyer[0].CompanyName %></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Corporate Id</
td
>
<
td
><%# ((CustomerEntity) Container.DataItem).Buyer[0].CorporateId%></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Full name</
td
>
<
td
><%# string.Format("{0} {1}", ((CustomerEntity) Container.DataItem).Buyer[0].Firstname, ((CustomerEntity) Container.DataItem).Buyer[0].Lastname) %></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Email</
td
>
<
td
style
=
"color:#000"
><
a
href="mailto:<%# ((CustomerEntity) Container.DataItem).Buyer[0].Email%>" style="color:#1e3287"><%# ((CustomerEntity) Container.DataItem).Buyer[0].Email%></
a
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Phone</
td
>
<
td
><%# ((CustomerEntity) Container.DataItem).Buyer[0].Phone%></
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold; vertical-align:top;"
>Address</
td
>
<
td
><%# ((CustomerEntity) Container.DataItem).Buyer[0].StreetAddress%>, <%# string.Format("{0} {1}", ((CustomerEntity) Container.DataItem).Buyer[0].PostalCode, ((CustomerEntity) Container.DataItem).Buyer[0].City) %>, <%# ((CustomerEntity) Container.DataItem).Buyer[0].Country %></
td
>
</
tr
>
</
table
>
</
div
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"PageView3"
BorderStyle
=
"Solid"
BorderColor
=
"Silver"
BorderWidth
=
"1"
>
<
div
style
=
"padding: 5px 5px 5px 5px;"
>
<
table
cellpadding
=
"2"
cellspacing
=
"0"
border
=
"1"
>
<
th
style
=
"width:225px"
>Product name</
th
>
<
th
style
=
"width:150px"
>Details</
th
>
<
th
style
=
"width:325px"
>Content items (courses)</
th
>
<
asp:Repeater
ID
=
"rptOrderDetails"
runat
=
"server"
>
<
ItemTemplate
>
<
tr
>
<
td
style
=
""
><%# Eval("Name") %></
td
>
<
td
><%# Eval("Quantity") %> x <%# Eval("SellingPriceForSingleProduct", "{0:C}")%><
br
/>
campaign code: <%# Eval("CampaignCodeUsed") ?? "none" %>
</
td
>
<
td
>
<
table
cellpadding
=
"2"
cellspacing
=
"0"
>
<
asp:Repeater
ID
=
"rptProductContent"
runat
=
"server"
DataSource='<%# ((ProductItemWrapper) Container.DataItem).ProductContentItems %>'>
<
ItemTemplate
>
<
tr
>
<
td
>Course: <%# Eval("Name") %><
br
/>
Possible activations amount: <%# Eval("Quantity")%><
br
/>
Activation key: <%# Eval("ActivationKey")%>
</
td
>
</
tr
>
</
ItemTemplate
>
<
SeparatorTemplate
>
<
tr
>
<
td
style
=
"line-height:1px; font-size:1px;"
><
hr
/></
td
>
</
tr
>
</
SeparatorTemplate
>
</
asp:Repeater
>
</
table
>
</
td
>
</
tr
>
</
ItemTemplate
>
</
asp:Repeater
>
</
table
>
</
div
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
div
>
</
div
>
</
NestedViewTemplate
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"140px"
HeaderText
=
"Order number"
DataFormatString
=
"TP{0}"
DataField
=
"CustomerIdPk"
SortExpression
=
"CustomerIdPk"
UniqueName
=
"CustomerIdPk"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"250px"
FilterListOptions
=
"VaryByDataType"
FilterControlWidth
=
"210px"
DataType
=
"System.Guid"
HeaderText
=
"Purchase guid"
DataField
=
"PurchaseGuid"
SortExpression
=
"PurchaseGuid"
UniqueName
=
"PurchaseGuid"
></
telerik:GridBoundColumn
>
<
customTelerik:CustomPaymentTypeFilteringColumn
HeaderStyle-Width
=
"120px"
HeaderText
=
"Payment method"
DataField
=
"PaymentMethod"
SortExpression
=
"PaymentMethod"
UniqueName
=
"PaymentMethod"
></
customTelerik:CustomPaymentTypeFilteringColumn
>
<
customTelerik:CustomOrderStatusFilteringColumn
HeaderStyle-Width
=
"140px"
HeaderText
=
"Order status"
DataField
=
"OrderStatus"
SortExpression
=
"OrderStatus"
UniqueName
=
"OrderStatus"
></
customTelerik:CustomOrderStatusFilteringColumn
>
<
telerik:GridCheckBoxColumn
HeaderStyle-Width
=
"100px"
HeaderText
=
"VAT applied"
DataField
=
"VATApplied"
DataType
=
"System.Boolean"
SortExpression
=
"VATApplied"
UniqueName
=
"VATApplied"
></
telerik:GridCheckBoxColumn
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"120px"
DataField
=
"OrderPriceWithoutVAT"
HeaderText
=
"Price (no VAT)"
DataFormatString
=
"{0:C}"
SortExpression
=
"OrderPriceWithoutVAT"
UniqueName
=
"OrderPriceWithoutVAT"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"120px"
DataField
=
"FinalOrderPrice"
HeaderText
=
"Final price"
DataFormatString
=
"{0:C}"
SortExpression
=
"FinalOrderPrice"
UniqueName
=
"FinalOrderPrice"
></
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
HeaderStyle-Width
=
"130px"
DataField
=
"ActivationKeysValidFrom"
DataType
=
"System.DateTime"
HeaderText
=
"Activation date"
SortExpression
=
"ActivationKeysValidFrom"
UniqueName
=
"ActivationKeysValidFrom"
></
telerik:GridDateTimeColumn
>
<
telerik:GridDateTimeColumn
HeaderStyle-Width
=
"130px"
DataField
=
"DateCreated"
DataType
=
"System.DateTime"
HeaderText
=
"Date created"
SortExpression
=
"DateCreated"
UniqueName
=
"DateCreated"
></
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"130px"
DataField
=
"CheckoutLang"
HeaderText
=
"Checkout language"
SortExpression
=
"CheckoutLang"
UniqueName
=
"CheckoutLang"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-Width
=
"120px"
DataField
=
"Description"
HeaderText
=
"Description"
SortExpression
=
"Description"
UniqueName
=
"Description"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
div
>
<
asp:ObjectDataSource
ID
=
"odsPaymentMethod"
TypeName
=
"XXX.ShopManager.Web.Controls.Sales_views.Orders_Customer_Buyer_View.OrdersCustomerBuyerView"
SelectMethod
=
"odsPaymentMethod_Select"
EnablePaging
=
"false"
runat
=
"server"
></
asp:ObjectDataSource
>
<
asp:ObjectDataSource
ID
=
"odsOrderStatus"
TypeName
=
"XXX.ShopManager.Web.Controls.Sales_views.Orders_Customer_Buyer_View.OrdersCustomerBuyerView"
SelectMethod
=
"odsOrderStatus_Select"
EnablePaging
=
"false"
runat
=
"server"
></
asp:ObjectDataSource
>
<
llblgenpro:LLBLGenProDataSource
ID
=
"customerDS"
runat
=
"server"
DataContainerType
=
"EntityCollection"
EnablePaging
=
"False"
CacheLocation
=
"ViewState"
EntityCollectionTypeName
=
"XXX.Data.CollectionClasses.CustomerCollection, XXX.Data"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"Id"
/>
</
SelectParameters
>
</
llblgenpro:LLBLGenProDataSource
>
<
llblgenpro:LLBLGenProDataSource
ID
=
"orderDS"
runat
=
"server"
DataContainerType
=
"EntityCollection"
EnablePaging
=
"True"
EntityCollectionTypeName
=
"XXX.Data.CollectionClasses.OrderCollection, XXX.Data"
>
</
llblgenpro:LLBLGenProDataSource
>
<
asp:XmlDataSource
ID
=
"xmlDsCountries"
DataFile
=
"~/Languages/countryList.xml"
XPath
=
""
TransformFile
=
"~/Languages/countriesSetup.xslt"
runat
=
"server"
></
asp:XmlDataSource
>
and source:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
XXX.Data.EntityClasses;
using
SD.LLBLGen.Pro.ORMSupportClasses;
using
XXX.Data.HelperClasses;
using
System.Data;
using
Telerik.Web.UI;
using
XXX.ShopManager.BL.Utils;
using
XXX.ShopManager.BL.Web.Shop;
namespace
XXX.ShopManager.Web.Controls.Sales_views.Orders_Customer_Buyer_View
{
public
partial
class
OrdersCustomerBuyerView : System.Web.UI.UserControl
{
#region Methods
protected
RadAjaxManager GetRadAjaxManager()
{
return
(RadAjaxManager)HelperMethods.FindControlRecursive(
this
.Page.Master,
"RadAjaxManager1"
);
}
public
string
[] odsPaymentMethod_Select()
{
return
Enum.GetNames(
typeof
(PaymentType));
}
public
string
[] odsOrderStatus_Select()
{
return
Enum.GetNames(
typeof
(OrderStatus));
}
#endregion
#region Events
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadAjaxManager manager = RadAjaxManager.GetCurrent(
this
.Page);
manager.AjaxSettings.AddAjaxSetting(gvOrdersCustomerBuyerView, gvOrdersCustomerBuyerView, (RadAjaxLoadingPanel)HelperMethods.FindControlRecursive(
this
.Page.Master,
"radLoadingPnl"
));
}
protected
void
gvOrdersCustomerBuyerView_ItemCommand(
object
source, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.ExpandCollapseCommandName)
{
if
(!e.Item.Expanded)
{
int
id = Int32.Parse(gvOrdersCustomerBuyerView.MasterTableView.DataKeyValues[e.Item.ItemIndex][
"CustomerIdPk"
].ToString());
Repeater rpt = (Repeater)HelperMethods.FindControlRecursive(((GridDataItem)e.Item).ChildItem,
"rptOrderDetails"
);
rpt.DataSource = OrderEntity.GetOrderContentProductsWithActivationCodesByOrderId(id).ToList();
rpt.DataBind();
}
}
else
if
(e.CommandName == RadGrid.FilterCommandName)
{
string
colName = ((Pair)e.CommandArgument).Second.ToString();
if
(colName.Equals(
"PurchaseGuid"
))
{
TextBox txt = (e.Item
as
GridFilteringItem)[colName].Controls[0]
as
TextBox;
string
guid = txt.Text.Trim();
try
{
new
Guid(guid); }
catch
{ e.Canceled =
true
; txt.Text =
string
.Empty; }
}
else
if
(colName.Equals(
"CustomerIdPk"
))
{
TextBox txt = (e.Item
as
GridFilteringItem)[colName].Controls[1]
as
TextBox;
string
id = txt.Text.Trim();
try
{ Int32.Parse(id); }
catch
{ e.Canceled =
true
; txt.Text =
string
.Empty; }
}
}
}
protected
void
gvOrdersCustomerBuyerView_UpdateCommand(
object
source, GridCommandEventArgs e)
{
}
protected
void
gvOrdersCustomerBuyerView_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item.ItemType == GridItemType.FilteringItem)
{
Label lbl =
new
Label();
lbl.Text =
"TP "
;
((GridFilteringItem)e.Item)[
"CustomerIdPk"
].Controls.AddAt(0, lbl);
}
}
protected
void
chkEnableMultiSort_CheckedChanged(
object
sender, EventArgs e)
{
gvOrdersCustomerBuyerView.MasterTableView.AllowMultiColumnSorting = ((CheckBox)sender).Checked;
gvOrdersCustomerBuyerView.MasterTableView.Rebind();
}
protected
void
btnClearFilter_Click(
object
sender, EventArgs e)
{
foreach
(GridColumn column
in
gvOrdersCustomerBuyerView.MasterTableView.Columns)
{
column.CurrentFilterFunction = GridKnownFunction.NoFilter;
column.CurrentFilterValue =
string
.Empty;
}
gvOrdersCustomerBuyerView.MasterTableView.FilterExpression =
string
.Empty;
gvOrdersCustomerBuyerView.MasterTableView.Rebind();
}
protected
void
gvOrdersCustomerBuyerView_DataBound(
object
sender, EventArgs e)
{
CheckBox chk = (CheckBox)HelperMethods.FindControlRecursive(gvOrdersCustomerBuyerView.MasterTableView,
"chkEnableMultiSort"
);
chk.Checked = gvOrdersCustomerBuyerView.MasterTableView.AllowMultiColumnSorting;
}
#endregion
}
}
0
Hello Shukhrat,
Could you please try updating an asp:GridView with the same data source and let me know whether it works for the boolean values.
I am looking forward to your reply.
Sincerely yours,
Mira
the Telerik team
Could you please try updating an asp:GridView with the same data source and let me know whether it works for the boolean values.
I am looking forward to your reply.
Sincerely yours,
Mira
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Shukhrat Nekbaev
Top achievements
Rank 1
answered on 04 Nov 2010, 07:57 PM
Hi, thanks for reply, I did following, I took my control (see above) and in the beginning of it added new RadGrid and below it GridView, binded both to same datasource. Nothing at all(!) is updatable using RadGrid and everything(!) is updatable using GridView:
<
telerik:RadGrid
ID
=
"gvOrdersCustomerBuyerView2"
runat
=
"server"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateEditColumn
=
"True"
DataSourceID
=
"orderDS"
GridLines
=
"None"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"CustomerIdPk"
DataSourceID
=
"orderDS"
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ActivationKeysValidFrom"
DataType
=
"System.DateTime"
HeaderText
=
"ActivationKeysValidFrom"
SortExpression
=
"ActivationKeysValidFrom"
UniqueName
=
"ActivationKeysValidFrom"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CheckoutLang"
HeaderText
=
"CheckoutLang"
SortExpression
=
"CheckoutLang"
UniqueName
=
"CheckoutLang"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CustomerIdPk"
DataType
=
"System.Int32"
HeaderText
=
"CustomerIdPk"
ReadOnly
=
"True"
SortExpression
=
"CustomerIdPk"
UniqueName
=
"CustomerIdPk"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DateCreated"
DataType
=
"System.DateTime"
HeaderText
=
"DateCreated"
SortExpression
=
"DateCreated"
UniqueName
=
"DateCreated"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Description"
HeaderText
=
"Description"
SortExpression
=
"Description"
UniqueName
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FinalOrderPrice"
DataType
=
"System.Decimal"
HeaderText
=
"FinalOrderPrice"
SortExpression
=
"FinalOrderPrice"
UniqueName
=
"FinalOrderPrice"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrderPriceWithoutVat"
DataType
=
"System.Decimal"
HeaderText
=
"OrderPriceWithoutVat"
SortExpression
=
"OrderPriceWithoutVat"
UniqueName
=
"OrderPriceWithoutVat"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OrderStatus"
HeaderText
=
"OrderStatus"
SortExpression
=
"OrderStatus"
UniqueName
=
"OrderStatus"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PaymentMethod"
HeaderText
=
"PaymentMethod"
SortExpression
=
"PaymentMethod"
UniqueName
=
"PaymentMethod"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PurchaseGuid"
DataType
=
"System.Guid"
HeaderText
=
"PurchaseGuid"
SortExpression
=
"PurchaseGuid"
UniqueName
=
"PurchaseGuid"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"VatApplied"
DataType
=
"System.Boolean"
HeaderText
=
"VatApplied"
SortExpression
=
"VatApplied"
UniqueName
=
"VatApplied"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridBoundColumn
DataField
=
"VatPercent"
DataType
=
"System.Double"
HeaderText
=
"VatPercent"
SortExpression
=
"VatPercent"
UniqueName
=
"VatPercent"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:GridView
ID
=
"GridView1"
runat
=
"server"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
CellPadding
=
"4"
DataKeyNames
=
"CustomerIdPk"
DataSourceID
=
"orderDS"
EnableModelValidation
=
"True"
ForeColor
=
"#333333"
GridLines
=
"None"
>
<
AlternatingRowStyle
BackColor
=
"White"
ForeColor
=
"#284775"
/>
<
Columns
>
<
asp:CommandField
ShowEditButton
=
"True"
ShowSelectButton
=
"True"
/>
<
asp:BoundField
DataField
=
"ActivationKeysValidFrom"
HeaderText
=
"ActivationKeysValidFrom"
SortExpression
=
"ActivationKeysValidFrom"
/>
<
asp:BoundField
DataField
=
"CheckoutLang"
HeaderText
=
"CheckoutLang"
SortExpression
=
"CheckoutLang"
/>
<
asp:BoundField
DataField
=
"CustomerIdPk"
HeaderText
=
"CustomerIdPk"
ReadOnly
=
"True"
SortExpression
=
"CustomerIdPk"
/>
<
asp:BoundField
DataField
=
"DateCreated"
HeaderText
=
"DateCreated"
SortExpression
=
"DateCreated"
/>
<
asp:BoundField
DataField
=
"Description"
HeaderText
=
"Description"
SortExpression
=
"Description"
/>
<
asp:BoundField
DataField
=
"FinalOrderPrice"
HeaderText
=
"FinalOrderPrice"
SortExpression
=
"FinalOrderPrice"
/>
<
asp:BoundField
DataField
=
"OrderPriceWithoutVat"
HeaderText
=
"OrderPriceWithoutVat"
SortExpression
=
"OrderPriceWithoutVat"
/>
<
asp:BoundField
DataField
=
"OrderStatus"
HeaderText
=
"OrderStatus"
SortExpression
=
"OrderStatus"
/>
<
asp:BoundField
DataField
=
"PaymentMethod"
HeaderText
=
"PaymentMethod"
SortExpression
=
"PaymentMethod"
/>
<
asp:BoundField
DataField
=
"PurchaseGuid"
HeaderText
=
"PurchaseGuid"
SortExpression
=
"PurchaseGuid"
/>
<
asp:CheckBoxField
DataField
=
"VatApplied"
HeaderText
=
"VatApplied"
SortExpression
=
"VatApplied"
/>
<
asp:BoundField
DataField
=
"VatPercent"
HeaderText
=
"VatPercent"
SortExpression
=
"VatPercent"
/>
</
Columns
>
<
EditRowStyle
BackColor
=
"#999999"
/>
<
FooterStyle
BackColor
=
"#5D7B9D"
Font-Bold
=
"True"
ForeColor
=
"White"
/>
<
HeaderStyle
BackColor
=
"#5D7B9D"
Font-Bold
=
"True"
ForeColor
=
"White"
/>
<
PagerStyle
BackColor
=
"#284775"
ForeColor
=
"White"
HorizontalAlign
=
"Center"
/>
<
RowStyle
BackColor
=
"#F7F6F3"
ForeColor
=
"#333333"
/>
<
SelectedRowStyle
BackColor
=
"#E2DED6"
Font-Bold
=
"True"
ForeColor
=
"#333333"
/>
</
asp:GridView
>
<
llblgenpro:LLBLGenProDataSource
ID
=
"orderDS"
runat
=
"server"
DataContainerType
=
"EntityCollection"
EnablePaging
=
"True"
EntityCollectionTypeName
=
"XXX.Data.CollectionClasses.OrderCollection, XXX.Data"
>
</
llblgenpro:LLBLGenProDataSource
>
0
Hello Shukhrat,
The described behavior seems like a bug.
It will be highly appreciated if you open a formal support ticket/bug report and send us the a small working project, demonstrating the issue. Our developers will debug it locally and find out the cause of the problem.
I am looking forward to your reply.
Best wishes,
Mira
the Telerik team
The described behavior seems like a bug.
It will be highly appreciated if you open a formal support ticket/bug report and send us the a small working project, demonstrating the issue. Our developers will debug it locally and find out the cause of the problem.
I am looking forward to your reply.
Best wishes,
Mira
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Emmanuel Bougnon
Top achievements
Rank 1
answered on 22 Dec 2010, 10:19 AM
Hi,
What's hapens about this problem.
is there a release which fixed ?
Thxs
What's hapens about this problem.
is there a release which fixed ?
Thxs
0

Shukhrat Nekbaev
Top achievements
Rank 1
answered on 22 Dec 2010, 10:23 AM
Hi,
Facing same issue? :)
I didn't have time to make a sample project and submit it to them using support ticket, hopefully will do on holidays soon.
Facing same issue? :)
I didn't have time to make a sample project and submit it to them using support ticket, hopefully will do on holidays soon.
0
Hello guys,
Please open a formal support ticket and send us a small working project, demonstrating the unwanted behavior. We will debug it locally and get back to you with our findings.
Thank you in advance for the cooperation.
Kind regards,
Mira
the Telerik team
Please open a formal support ticket and send us a small working project, demonstrating the unwanted behavior. We will debug it locally and get back to you with our findings.
Thank you in advance for the cooperation.
Kind regards,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.