iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
(This is my 4th time trying to Submit this. Excuse me if there are multiples.)
I am trying to populate List Items in a Column of EditType DropDownList or WebComboNet based on a Value in the same Row.
As an example with the Northwind database, each WebGrid Row would contain [Order Details].[OrderID]. On the same WebGrid Row there would be a Column of EditType DropDownList/WebComboNet EditType that is a List of [Order Details].[ProductID]s for that [Order Details].[OrderID]
I see I can link the WebCombo to another WebCombo but that is not my case. My case would be a WebGridColumn of EditType NoEdit or just a value in the DataRow.
With MS Gridview, I can dynamically populate a DropDownList in the Gridview's RowDataBound Server-Side Event.
I have looked at the OnInitializeRow Server-Side Event and can get the Row Values but can not figure out how to get to the ValueList of the DropDownList or WebCombo in that Row.
I image I could use Client-Side Load on Demand or On the Fly Postback however since the ListItem List count would be less than 10, I don't want to experience the delay of a round-trip back to the Server.
Thanks,
Doug
You could use the HiddenDataMember property in the Category cell and buffer the Name value in that cell. During OnEnterEditMode instead of looking up the value in the Name cell you could look up the value in the HiddenDataMember property.
Here is the snippet to use HiddenDataMember:
<ISWebGrid:WebGridColumn Bound="true" HiddenDataMember="Name" WebComboID="cboCategory" EditType="WebComboNET" Name="Category" DataMember="Category"> <ValueList DataTextField="Type" DataValueField="ID"></ValueList></ISWebGrid:WebGridColumn>
The modified OnEnterEditMode event handler, I also modified this function so the process is only done upon entring Category cell:
function wgTest_EnterEditMode(controlId, tblName, editObject) { if (editObject.ToCellObject().Name == "Category") { var combo = editObject.element; var cellObj = editObject.ToCellObject(); var nameVal = editObject.cellElement.getAttribute("Name"); combo.SetAdditionalFilters("Name = '" + nameVal + "'"); combo.SetText(cellObj.Text, true); } return true;}
Our WebValueList is intended for per column scenario, the WebValueList property is available in the Column object not in the Row object. In your scenario, per row, the WebValueList will not be appropriate.
In your case, you will need to manually translate the value during initialize row event handler
Thank you for confirming my observations.
As stated in my first posting:
"I have looked at the OnInitializeRow Server-Side Event and can get the Row Values but can not figure out how to get to the ValueList of the DropDownList or WebCombo in that Row."
So, how do I populate the DropDownList/WebComboNet based on a value in that row which may be different per row?
Are there any solutions?
No one is answering Live Chat.One other note on what I am trying to do.
I am saving the Text, [Order Details].[ProductName], from the DropDownList/WebComboNet to the database. [Order Details].[CatgoryID] is the Value and used to filter the List. E.g. all Product Names in a Category would be displayed in the List.
I have attached a sample based on your scenario, hopefully it is quite similar. If you would like to filter the WebCombo value you could use the SetAdditionalFilter function during EnterEditMode WebGrid client side event handler.
Hi,
At first I didn't think your sample was working because the only item in the DropDown was the Selected Item.
Adding WebCombo.LayoutSettings.AlwaysShowAllRowsOnDropdown true made it reveal the rest of the items.
To confirm, there is now way to get the WebCombo ValueList in the Server-Side IntializeRow Event or get the Row Data and Column Controls at the same time?
The keys to your sample where to:
- add a hidden column to WebCombo to Filter on.
- WebGrid.ClientSideEvents.OnEnterEditMode did a WebCombo.SetAdditionalFilters
In the WebGrid.ClientSideEvents.OnEnterEditMode, the lookup value exists in a WebGrid Column. In my case I don't need to display that info to the User and if make it not visible, I can not get the Value using a GetCell() Method.
My current work around is make the WebGrid.Width 0, but I still see some of it.
Is there a cleaner way to get the Value so I don't have to show it in the Grid?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname