Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,
I would like to add a radio button in a column of a webgrid in Asp VB .Net
But, I can't understand the syntax.

What I have tried:

I tried :
grdProfils.Column("Select",, Function(ret)  @html.RadioButton("ProfilId", item.Id, False)),


But :
1) I don't realy know what is "ret"
2) VS says : "expected expression" before @html

what is wrong ?

Thanks
Posted
Updated 13-Jun-21 23:53pm
Comments
CHill60 11-Jun-21 9:45am    
Do you have a function called "Function" and a variable called "ret" ?
Eric Dubois 12-Jun-21 8:20am    
No, in C# :
grid1.Column("EmployeeId",format: (item) => Html.RadioButton("EmployeeId",
(int)item.Salary, new { @class = "radio" }), header: "Select"),

I tried to follow this page :
https://forums.asp.net/t/1664969.aspx?WebGrid+Column+Format+in+vbhtml

But "ret" is of my own. I don't know what I must put.

And no, I haven't any function called Function. Function is just a key word for format.

Any idea ?

Thank's

1 solution

And the solution is :
grdProfils.Column("Select", Nothing, format:=
               Function(item)
                   Return Html.RadioButton("ProfilId", item.Id, False)
               End Function),
 
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