iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
Im trying a cenario with webcombo box, and til now a could get all running correctly.
I was wondering if someone could give me an example of a unboud combo that gets its rows added in client side and another example in server side.
But i want this example of data:
text: item 1, value:1
text: item 2, value:2
and then i wanto to be able in client side and server side to get the onselecteditem the value of combo.
Can anyone help me?
Tanks
In order to have unbound WebCombo that has different text and value for each row, I suggest you to use the “PopulateUnboundData” method. You may check MultipleSelection_Unbound.aspx reference sample file in WebComboSamples project.
Hope this helps.
That takes care of the server side part.
How about the client side creation of an unbound webcombo with differente text and value?
You can add the script below in order to create unbound WebCombo from client side.
<script language="javascript" type="text/javascript"> <!-- function Button1_onclick() { var WebCombo1 = ISGetObject("WebCombo1"); var rows = WebCombo1.GetRows(); var newRow = WebCombo1.NewRow("ROW0"); var cells = newRow.GetCells(); cells.GetNamedItem("Column0").Text = "item 1"; cells.GetNamedItem("Column1").Text = "1"; rows.Add(newRow); WebCombo1.UpdateUI(); return true; } --> </script>
<ISWebCombo:WebCombo ID="WebCombo1" runat="server" UseDefaultStyle="true"> <Columns> <ISWebCombo:WebComboColumn BaseFieldName="Column0" Bound="False" HeaderText="Column0" Name="Column0" /> <ISWebCombo:WebComboColumn BaseFieldName="Column1" Bound="False" HeaderText="Column1" Name="Column1" /> </Columns> <LayoutSettings ComboMode="MultipleColumns"> </LayoutSettings> </ISWebCombo:WebCombo>
When using the javascript, after user selects any text from WebCombo, WebCombo1.Text will returns the selected text and WebCombo1.Value will return empty string (since it is unbound WebCombo) Hope this helps.
Hello Yudi,
I think you just answered on of my questions.
In unbound mode/ client side, the webcombo.Value property is empty, that meaning you cannot simulate the behaviour of a asp.net combo in client side (getting the text/value).
Tanks for the reply
Best regards,
Ricardo
Hi,
I also have the same problems to be solved!
And I think your questions are too slow.
If I use this code, it will raise error: 无法从其“Value”属性的字符串表示形式“ChaELv”创建“System.Object”类型的对象。
<ISWebCombo:WebComboCell Text="差额率" Value="ChaELv"> </ISWebCombo:WebComboCell>
Deeply apologize for the late respond.
It is recommended to set the Value property of WebComboCell in code behind instead of set it by design. This is due to the fact that the Value property accepts object data type.
In order to get an unbound WebCombo that simulates the behavior of a ASP.NET combo, you might want to try following approach.
<ISWebCombo:WebCombo ID="WebCombo1" runat="server" UseDefaultStyle="True" ViewStateStorage="None" Height="20px" Width="200px"> <Columns> <ISWebCombo:WebComboColumn Name="ContactName" Bound="False" Width="100%"></ISWebCombo:WebComboColumn> <ISWebCombo:WebComboColumn Name="ContactID" Bound="False" Hidden="True" RenderOnHidden="True" /> </Columns> <Rows> <ISWebCombo:WebComboRow> <Cells> <ISWebCombo:WebComboCell Text="Andrew"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Andr"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> <ISWebCombo:WebComboRow Position="1"> <Cells> <ISWebCombo:WebComboCell Text="Brad"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Brad"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> <ISWebCombo:WebComboRow Position="2"> <Cells> <ISWebCombo:WebComboCell Text="Cindy"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Cind"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> <ISWebCombo:WebComboRow Position="3"> <Cells> <ISWebCombo:WebComboCell Text="Daniel"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Dani"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> <ISWebCombo:WebComboRow Position="4"> <Cells> <ISWebCombo:WebComboCell Text="Paul"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Paul"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> <ISWebCombo:WebComboRow Position="5"> <Cells> <ISWebCombo:WebComboCell Text="Ronald"> </ISWebCombo:WebComboCell> <ISWebCombo:WebComboCell Text="Rona"> </ISWebCombo:WebComboCell> </Cells> </ISWebCombo:WebComboRow> </Rows> </ISWebCombo:WebCombo>
The idea is: creating a WebCombo that has two columns, ContactName column and ContactID column. While the ContactName column will be rendered, ContactID column is not going to be rendered. It will be act like a hidden column that can be used to store the ID information of the selected row.
The ID can be obtained by using:
string ID = WebCombo1.SelectedRow.Cells[1].Text;
Please let us know your response whether this helps or not.
I think I should know how to do it. Thank you very much!
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