F#从DataGridView中的选定行的单元格中获取值 [英] F# Get Value from Cell from Selected Row in DataGridView

查看:99
本文介绍了F#从DataGridView中的选定行的单元格中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我在F#中的程序有点问题。我的DataGridView中有一个数据 - 大约10行。我想从选定的行中获取数据作为单击按钮的事件(我想从这些选定的行中获取单元格(0)的值)但是我不知道如何做到这一点。我不知道如何解决我的问题。我无法在互联网上找到任何有用的信息来解决我的问题。我做错了什么?



   mutable  zmiennaGetId =   pusty 
// akcja dla przycisku rezerwuj
PrzegladajZbioryButtonRezerwacja.Click.Add(有趣 a - >

zmiennaGetId< - DataGridViewRezerwacje.SelectedRows.Cells( 0 )。Value.ToString () ???? - 这样的东西在 C#:(

MessageBox.Show(zmiennaGetId)|> ;忽略

解决方案

你好,



我尝试,尝试尝试,最后解决我的问题。我给出解决方案可能对某人有用 - 我使用下面的代码来显示必要的数据:





   mutable  zmienna1 =   pusta 

e DataGridViewRezerwacje.SelectedRows do
zmienna1< - e.Cells。[ 0 ]。Value.ToString()

MessageBox.Show(zmienna1)|>忽略


Hello,

I have a little problem with my program in F#. I have a data in my DataGridView - about 10 rows. I would like to get a data from selected rows as "event for click the button" (exactly i want to get value from cells(0) from this selected rows) but a dont know how i can do this. I dont have any idea how solution my problem. I cant find any helpful information on the Internet to resolve my problem. What I doing wrong ?

let mutable zmiennaGetId = "pusty"
//akcja dla przycisku rezerwuj
PrzegladajZbioryButtonRezerwacja.Click.Add(fun a ->

zmiennaGetId <- DataGridViewRezerwacje.SelectedRows.Cells(0).Value.ToString() ???? - something like this is working in C# :(

MessageBox.Show(zmiennaGetId) |>ignore
)

解决方案

Hello,

I try,try and try and at last resolve my problem. I give solution maybe will be useful to someone - i use below code to display necessary data:


let mutable zmienna1 = "pusta"

for e in DataGridViewRezerwacje.SelectedRows do
    zmienna1 <- e.Cells.[0].Value.ToString()

MessageBox.Show(zmienna1) |> ignore


这篇关于F#从DataGridView中的选定行的单元格中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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