Welcome Guest Search | Active Topics | Sign In | Register

Display Radio button in cell of grid Options
sstoos
Posted: Wednesday, December 17, 2008 8:12:58 PM
Rank: Member
Groups: Member

Joined: 10/8/2007
Posts: 18
I need to be able to display a radio button in the cell of the grid and once the user selects the radio button, be able to capture the product id for that row and pass it to the server side. I'm not very good with javascript, so I'm not sure how to find the value and then pass it to my code behind. Is this possible?

I tried adding the asp:radiobutton to the customcolumn of my grid and it won't even display.
<eo:CustomColumn Width="80" > <EditorTemplate>
<asp:RadioButton runat="server" ID="rbtnSelect" />
</EditorTemplate>
</eo:CustomColumn>

Please help.
Thanks!
-s
eo_support
Posted: Thursday, December 18, 2008 1:56:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

That is possible. You would need to first set the Grid's KeyField to the data field in which you store your product Id. That value is then carried by the Grid to the client and you can then use this function to access it:

http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.GridItem.getKey.html

In order to call this function, you will need to have the GridItem object first. You can do that by handling the CustomColumn's ClientSideBeginEdit and take the cell object passed to your handler to save the item index, and later use eo_GetObject("Grid1").getItem(index) to get the Grid item object. You can find more details about ClientSideBeginEdit here:

http://www.essentialobjects.com/ViewDoc.aspx?t=Grid%2fcustom_column.html

Hope this helps.

Thanks!
Texwinca Developer
Posted: Thursday, April 16, 2009 1:03:15 AM
Rank: Advanced Member
Groups: Member

Joined: 3/31/2009
Posts: 52
I would like to place a "ASP:DropDownList" inside a custom column. The dropdownlist is dynamically generated at server side according to different criteria. How to do it?

<eo:CustomColumn
ClientSideBeginEdit="on_begin_edit"
ClientSideEndEdit ="on_end_edit"
DataField="LOC_CODE" HeaderText="LOC_CODE">
<EditorTemplate>
<asp:DropDownList ID="ddlLOC_CODE" runat="server">
</asp:DropDownList>
</EditorTemplate>
</eo:CustomColumn>
Texwinca Developer
Posted: Thursday, April 16, 2009 4:36:21 AM
Rank: Advanced Member
Groups: Member

Joined: 3/31/2009
Posts: 52
I found the solution from the forumn. <-- (but it really spent a lot of time to find out the solution)

Dim column As EO.Web.CustomColumn
Dim ddlLOC_CODE As DropDownList
column = CType(Me.Grid1.Columns(0), EO.Web.CustomColumn)
ddlLOC_CODE = CType(column.EditorInstance.FindControl("ddlLOC_CODE"), DropDownList)
ddlLOC_CODE.DataSource = dt
ddlLOC_CODE.DataTextField = "LOC_DESCR"
ddlLOC_CODE.DataValueField = "LOC_CODE"
ddlLOC_CODE.DataBind()
eo_support
Posted: Thursday, April 16, 2009 7:48:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. That's the correct way to do it. EditorInstance is the key.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.