根据其名称以编程方式设置 XAM Datagrid 的选定项目
与此类似的事情。
private void SearchResult(string nameOfBean)
{
foreach (Record VARIABLE in mbeanDataGrid.Records)
{
if (VARIABLE.ToString().Contains(nameOfBean))
{
((VARIABLE as DataRecord).DataItem as Record).IsSelected = true;
}
}
}
不过我知道这个语法是错误的,我正在寻找一些建议!几乎可以通过代码选择该项目(就像您单击了它一样)。根据它的名字。
Something along the lines of this.
private void SearchResult(string nameOfBean)
{
foreach (Record VARIABLE in mbeanDataGrid.Records)
{
if (VARIABLE.ToString().Contains(nameOfBean))
{
((VARIABLE as DataRecord).DataItem as Record).IsSelected = true;
}
}
}
However i know this syntax is wrong and im looking some advice! Pretty much to select the item (As if you had clicked on it) via code. According to its name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下代码选择记录(如果您想选择多个记录)
,或者如果您只想激活并选择一条记录,请执行此操作
希望这会有所帮助
you can select records with the following code (if you want select more than one record)
or if you only want to activate and select a record then do this one
hope this helps