HI
I need to select an item in a webcombo based on the value of the first column.
I need a webcombo property similar to .selectedIndex to give it a string value.
can anybody help me,
thanks
Hello,
Did you check our online samples there is a such scenario implemented:
Dynamically populated WebCombo
Reference documentation about the component you will find here:
Documentation WebCombo
Let me know if you have questions.
Hi ,
thanks for your quick reply,
yes, I have looked at the samples before but I didn't find my answer there.
I want the web combo to get value from the database when loading the page. so I want it to have a selected value based on the database.
I know how to get the value from the web combo but I don't know how to set this value.
thx,
Hi,
I have tested several ways to select a row form code - behind but it looks like that the combo ignores this approach for example :
if (!IsPostBack) { WebCombo1.DataSource = MakeTable(); WebCombo1.DataBind(); WebCombo1.Rows[0].Selected = true;
}
I can suggest you only way to select a row from client -side code like this:
function SelectRow() { var combo = igcmbo_getComboById('WebCombo1') combo.grid.Rows.rows[1].select(); }
Actually you can get the selected value, row , index and so on... but after user iteration all this is available to you in code-behind.
Thanks Redo for your help,
my problem is that I don't know the row number. it changes based on the database table change. all what I know is the value of the row that I want to select.
Do you think that the client -side code will resolve your issue if it is true I will provide you a function how to find a given row (cell its value) and select it.
It would be great if you send me this function, and I will try it.