|
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
|
|
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.htmlIn 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.htmlHope this helps. Thanks!
|
|
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>
|
|
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()
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Yes. That's the correct way to do it. EditorInstance is the key.
|
|