Hi, Telerik's team
I am with a problem on try perform updates in my radlistview filled by an objectdatasource.
I can put my radlistview in edit mode using "commands", but I cant update the data.
I used the template displayed in the radlistview page to create my page, but there are not example about how to make updates in radlistview using objectdatasource.
Please, give me a way to update data in control and after edition end, I wanna get the edited data and save in my database.
I am with a problem on try perform updates in my radlistview filled by an objectdatasource.
I can put my radlistview in edit mode using "commands", but I cant update the data.
I used the template displayed in the radlistview page to create my page, but there are not example about how to make updates in radlistview using objectdatasource.
Please, give me a way to update data in control and after edition end, I wanna get the edited data and save in my database.
<
telerik:RadListView
ID
=
"radListView"
ItemPlaceholderID
=
"CustomersContainer"
runat
=
"server"
OnItemCommand
=
"radListView_ItemCommand"
DataKeyNames
=
"ID"
AllowPaging
=
"True"
PageSize
=
"1"
Width
=
"90%"
>
<
LayoutTemplate
>
<
fieldset
id
=
"fsRadListView"
style
=
"width: 1000px !important;"
>
<
legend
style
=
"margin:0px 0px 0px 15px !important"
>Empréstimos</
legend
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
width
=
"100%"
>
<
tr
>
<
td
>
<
telerik:RadDataPager
ID
=
"RadDataPager1"
runat
=
"server"
PagedControlID
=
"radListView"
PageSize
=
"1"
>
<
Fields
>
<
telerik:RadDataPagerButtonField
FieldType
=
"FirstPrev"
></
telerik:RadDataPagerButtonField
>
<
telerik:RadDataPagerButtonField
FieldType
=
"Numeric"
></
telerik:RadDataPagerButtonField
>
<
telerik:RadDataPagerButtonField
FieldType
=
"NextLast"
></
telerik:RadDataPagerButtonField
>
<
telerik:RadDataPagerGoToPageField
SubmitButtonText
=
"Go"
TextBoxWidth
=
"15"
/>
<
telerik:RadDataPagerTemplatePageField
>
<
PagerTemplate
>
<
div
style
=
"float: right"
>
<
b
>Items
<
asp:Label
runat
=
"server"
ID
=
"CurrentPageLabel"
Text="<%# Container.Owner.StartRowIndex+1%>" />
to
<
asp:Label
runat
=
"server"
ID
=
"TotalPagesLabel"
Text="<%# Container.Owner.StartRowIndex+Container.Owner.PageSize %>" />
of
<
asp:Label
runat
=
"server"
ID
=
"TotalItemsLabel"
Text="<%# Container.Owner.TotalRowCount%>" />
<
br
/>
</
b
>
</
div
>
</
PagerTemplate
>
</
telerik:RadDataPagerTemplatePageField
>
</
Fields
>
</
telerik:RadDataPager
>
</
td
>
</
tr
>
</
table
>
</
fieldset
>
<
asp:PlaceHolder
ID
=
"PlaceHolder"
runat
=
"server"
></
asp:PlaceHolder
>
<
br
> </
LayoutTemplate>
<
ItemTemplate
>
<
fieldset
class
=
"fieldSetBackgroud"
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Product :</
label
>
<
asp:Label
ID
=
"lblProduto"
runat
=
"server"
Text='<%# Eval("ProductName")%>'></
asp:Label
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelFormulario"
>Factory :</
label
>
<
asp:Label
ID
=
"Label10"
runat
=
"server"
Text='<%# Eval("Factory")%>'></
asp:Label
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Amount :</
label
>
<
asp:Label
ID
=
"Label11"
runat
=
"server"
Text='<%# Eval("Amount")%>'></
asp:Label
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Total Price :</
label
>
<
asp:Label
ID
=
"Label15"
runat
=
"server"
Text='<%# Eval("TotalPrice")%>'></
asp:Label
>
</
div
>
<
asp:Button
ID
=
"btnEdit"
runat
=
"server"
Text
=
"Edit"
CommandName
=
"Edit"
class
=
"edit button"
></
asp:Button
>
</
fieldset
>
</
ItemTemplate>
<
EditItemTemplate
>
<
fieldset
class
=
"fieldSetBackgroud"
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Product:</
label
>
<
asp:Label
runat
=
"server"
Text='<%# Eval("ProductName")%>'></
asp:Label
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Factory:</
label
>
<
telerik:RadTextBox
ID
=
"txtFactory"
runat
=
"server"
Text='<%# Eval("Factory")%>'></
telerik:RadTextBox
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelForm"
>Quantidade :</
label
>
<
telerik:RadNumericTextBox
ID
=
"txtAmount"
runat
=
"server"
Value='<%#Eval("Amount")%>' ></
telerik:RadNumericTextBox
>
</
div
>
<
div
class
=
"divForm"
style
=
"text-align: left"
>
<
label
class
=
"labelFormulario"
>Total Price :</
label
>
<
telerik:RadNumericTextBox
ID
=
"txtTotalPrice"
runat
=
"server"
Value='<%#Eval("TotalPrice")%>'></
telerik:RadNumericTextBox
>
</
div
>
<
asp:Button
ID
=
"btnUpdate"
runat
=
"server"
Text
=
"Update Item"
CommandName
=
"Update"
ToolTip
=
"Apply changes."
></
asp:Button
>
<
asp:Button
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Cancel"
CommandName
=
"Cancel"
></
asp:Button
>
</
fieldset>
</
EditItemTemplate>
</
telerik:RadListView>
<
asp:ObjectDataSource
ID
=
"objectdatasource"
runat
=
"server"
SelectMethod
=
"ListItems"
TypeName
=
"...my namespace..."
></
asp:ObjectDataSource
>