Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 ?

F#
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
)
Posted

1 solution

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:


F#
let mutable zmienna1 = "pusta"

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

MessageBox.Show(zmienna1) |> ignore
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900