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
85
Web Combo Value in Web Grid Cell
posted

Hi folks,

I have a WebGrid set up with a WebCombo as a cell editor so that a user can select a value from the drop down to populate the cell value. I have type ahead set up on the WC and it has been working well.

If you try and type a value that is not in the drop down list, when you click out of the cell it simply blanks the value. Is it possible to modify the WG/WC behaviour to allow a value to be selected from the drop down and also allow a user to type in a value.

I realise what i'm askin kind of goes against having the drop down in the first place but if this can be done it would be very helpful.

I appreciate any help.

Thanks.
Jonny

Parents
No Data
Reply Children
  • 5
    posted in reply to [Infragistics] Helen Emerson

    I am trying to use a combo box on a WebGrid so that I can have the benefit of adding new values to existing items.

    I am using a free ComboBox control for ASP.NET from MetaBuilders http://www.metabuilders.com/ and I can successfully populate a ComboBox outside of a webgrid.  How can I use a combo box on a column of the webgrid?

    This is what I have attempted so far (following the way to add a WebMaskedEdit control) but failed to work.

    1)  Declared a instance of the ComboBox

    Protected WithEvents cboHomeOfRecord As New MetaBuilders.WebControls.ComboBox

     2) In the IntializeLayout event, added the ComboBox to the Web Form:

    If Not pForm1 Is Nothing Then

     With cboHomeOfRecord

     .Enabled = True

     .Visible = True

     .ID = "cboHomeOfRecord"

     End With

     pForm1.Controls.Add(cboHomeOfRecord)

    End If

     3) In the IntializeLayout event, added the ComboBox to the Web Form:

     cboHomeOfRecord.DataSource =  (some function that returns an arryalist of objects)

    cboHomeOfRecord.DataMember =(Some field name )

    Note: a combo box control outside of a webgrid has been successfully populated by the same code as above, so I know the data source is correct

    4)  In IntializeLayout event, tied the ComboBox to a column of the Grid:

    ugrdMain.Bands(0) .FromKey("HomeOfRecord")

    .HeaderText = "Home of Record"

    .Type = ColumnType.Custom

    .EditorControlID = "cboHomeOfRecord"

    .Width =
    New Unit(150)

     

    Any advice is much appreciated.