Telerik Radgrid selectedItems向var对象返回null

时间:2019-12-24 06:53:56

标签: telerik radgridview

if (GForm.Items.Count > 0)
{
    if (MessageBox.Show("Do You Want to delete this Style?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
    {
        //do no stuff
    }
    else
    {
        System.Data.DataRowView row1 = ((System.Data.DataRowView)GForm.SelectedItem);
        var t = row1.Row.ItemArray[0].ToString();
          WebRequest.Create(CommonCls.MainUrl + "Item/ItemMst.svc/DeleSiz/PrcCode=" + t.ToString() + "/Process").GetResponse().Close();
        Psource = (List<Process>)new DataContractJsonSerializer(typeof(List<Process>)).ReadObject(WebRequest.Create(CommonCls.MainUrl + "Item/ItemMst.svc/RtrProcess/" + CommonCls.Compny).GetResponse().GetResponseStream());
        Prc = ToDataTable(Psource.ToList());
        GForm.ItemsSource = Prc.DefaultView;
        int num = (int)MessageBox.Show("Sucessfully Deleted");

    }

--- row1通常首先获得空值如果第二次输入它给出空值或强制转换错误,我可以得到值。

0 个答案:

没有答案