Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Adding Data to WebCombo Programatically

Last post 11-05-2008 1:04 by mateia. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-05-2008 15:44

    • Mike Malter
    • Not Ranked
    • Joined on 05-31-2008
    • San Rafael
    • Points 80

    Adding Data to WebCombo Programatically

    I have searched high and low for this and can't figure out how to add data to a WebCombo control programatically. Can someone please point me to a code snippet or knowledgbase article? Thanks.
    Filed under:
    • Post Points: 35
  • 11-04-2008 14:07 In reply to

    Re: Adding Data to WebCombo Programatically

    Hello,

     Adding rows to the WebCombo is quite easy.  All you need to do is add a few columns, and then add a few rows.  Below is a simple snippet of what you will have to do.

    protected void Page_Load(object sender, EventArgs e)

    {

    if (!IsPostBack)

    {

    this.WebCombo1.Columns.Clear();

    UltraGridColumn col1 = new UltraGridColumn();

    col1.Key = "Col1";

    col1.Header.Caption = "Column1";

    this.WebCombo1.Columns.Add(col1);

    UltraGridColumn col2 = new UltraGridColumn();

    col2.Key = "Col2";

    col2.Header.Caption = "Column2";

    this.WebCombo1.Columns.Add(col2);

    UltraGridColumn col3 = new UltraGridColumn();

    col3.Key = "Col3";

    col3.Header.Caption = "Column3";

    this.WebCombo1.Columns.Add(col3);for (int i = 0; i < 10; i++)

    {

    UltraGridRow row = new UltraGridRow();

    this.WebCombo1.Rows.Add(row, false, true);

    this.WebCombo1.Rows[i].Cells[0].Value = i.ToString();

    this.WebCombo1.Rows[i].Cells[1].Value = "More " + i.ToString();this.WebCombo1.Rows[i].Cells[2].Value = "Text" + i.ToString();

    }

    this.WebCombo1.DataValueField = "Col1";

    this.WebCombo1.DataTextField = "Col3";

     

    }

    }

    Steve Osterberg
    Corporate Trainer
    • Post Points: 5
  • 11-05-2008 1:04 In reply to

    • mateia
    • Top 75 Contributor
    • Joined on 11-20-2007
    • Points 959

    Re: Adding Data to WebCombo Programatically

    Hello,

    If you need to add new rows from JavaScript, look here:

    http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7700

     

    I recommend you to have a look in three places:

    a) Infragistics knowledge base

    http://devcenter.infragistics.com/Support/KnowledgeBaseResults.aspx?type=Full&query=webcombo&articletypes=0&age=0&sort=LastModifiedDate&samplesonly=0

    b) The old Infragistics forum

    http://forums.archive.infragistics.com/?heirarchy=infragistics.products.netadvantage.aspnet

    c) Have a look in the help documentation file installed on your computer. Search the JavaScript functions that add new rows to an UltraWebGrid. 

      This is because the webCombo uses an UltraWebGrid for its dropdown portion.

    • Post Points: 5
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems