Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
WebCombo databinding
posted

I'm able to bind the WebCombo control to a datasource so it shows the list of values in the dropdown, but I can't figure out how to bind it to another datasource that will have the selected value.  In the MS DropDownList, there's a SelectedValue property that can be bound, what's the equivalent for the WebCombo?  I've tried using DisplayValue but get an error that Bind/Eval "can only be used in the context of a databound control".

Nathan

Parents
No Data
Reply
  • 356
    posted

    Nathan,

    You can use something like this:

    this.webCombo.Rows.FromKey("1").Selected = true; //if you want to select the row with Id=1

     In the InitializeRow event you must set the key:
    protected void webCombo_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
    {
                e.Row.Key = e.Row.Cells.FromKey("Id").Text;
    }

     I hope it help.

    Johni Ecco 

Children