c# - C# 获取选定的 IGridDataRow 值桌面应用程序
问题描述
在我的 WindowsForms 项目中,我有一个带有 CellEditor 的类(IGridDataRow 行),我想获取所选项目的值并将其传递给另一个类。
namespace Projects.test.Gui
{
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]
public class testAttribute : Attribute, IEditorAttribute
{
public CellEditor GetEditor(IGridDataRow row)
{
try
{
List<string> Names = new List<string>();
Helper Helper = new Helper();
Namesdata[] mNames = Helper.FindAllNames();
if (mNames != null)
{
Names = mNames.Select(mName => mName.Name).ToList();
}
return new ButtonEditor(Names);
}
catch (Exception ex)
{
LogService.LogError(ex.Message);
return null;
}
}
解决方案
推荐阅读
- flutter - google_mobile_ads 0.13.0 插件横幅广告在颤振应用中调用 setstate 时自动重新加载
- python - 我在 pycharm 上下载 Flask-MySQLdb 时遇到问题,并且一直收到此错误
- python - 有人可以指出我逻辑中的错误。(编码练习)
- flutter - 在 Flutters 空安全中使用 List 让我感到困惑
- camera - Flutter web如何使用相机获取图像并上传到firebase存储
- ios - iOS:在 UIViewRepresentable 和 View 之间进行函数调用,SwiftUI
- c++ - 如何在 C++ 中使用模板化方法?
- python - Sklearn - 我们可以在同一模型中使用交叉验证和批量训练吗?
- amazon-web-services - AWS Toolkit for VSCode 缺少用于导入 lambda 函数的选项
- r - 使用 rgee 提取地球引擎中图像采集的多个纬度值