This question is locked. New answers and comments are not allowed.
Hello,
I have an domaindatasource defined in XAML that is not bound to any controls. I use it to add items and delete items to a table in the database.
<
telerik:RadDomainDataSource
Name
=
"ddsAllRules"
QueryName
=
"GetAllRules"
AutoLoad
=
"True"
SubmittedChanges
=
"dds_SubmittedChanges"
>
<
telerik:RadDomainDataSource.DomainContext
>
<
server:SSAssetsDomainContext
/>
</
telerik:RadDomainDataSource.DomainContext
>
</
telerik:RadDomainDataSource
>
Adding an item works fine - it's the Remove that is not working. Here is the code snippet:
private
void
btnDelete_Click(
object
sender, RoutedEventArgs e)
{
var rule =
new
SSAssets.Web.Rule
{
RuleID = (
string
)rcbRule.Text, RuleType=(
string
)ddsRules.QueryParameters[0].Value
};
this
.ddsAllRules.DataView.Remove(rule);
//this.ddsAllRules.DataView.RemoveAt(0);
this
.ddsAllRules.SubmitChanges();
ddsRules.Load();
}
I set a break in the delete method of the domainservice code but it never breaks. When I use RemoveAt, it breaks and works as expected.
Any help would be appreciated!
Cheri