从列表中删除记录 [英] deleting the record from the list

查看:96
本文介绍了从列表中删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#创建一个项目,并在silverlight3中进行设计.
我在silverlight3中有一个名为"grdurlDelete"的网格
假设我从网格中选择了记录,然后将其删除,然后将其删除..

现在假设未选择记录,我输入了删除按钮.该消息应
在删除之前显示请选择记录"

我放了这段代码,但它不起作用

I am making a project in c# and designing in silverlight3.
I have a grid in silverlight3 named as "grdurlDelete"
suppose I select the record from the grid and delete it then its deleted..

now suppose without selecting the record i enter the delete button..the message should
be shown that "Please select the record" before deleting

I put this code but its not working

if (grdUrlDelete.ItemsSource == null)
{
    MessageBox.Show("Please select the record!!", "PLO", MessageBoxButton.OK);
}





help me for with the right code.

推荐答案

ItemsSource用于数据绑定,可能与问题无关.看看Selection属性.
The ItemsSource is for databinding and is probably not relevent. Have a look at the Selection property.


这篇关于从列表中删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆