WebCombo

How do I populate a webcombo component of infragistics programmatically in my aspx webpage. I am using .NET



Moiz
LVL 4
Moizsaif123Asked:
Who is Participating?
 
liebrandConnect With a Mentor Commented:
Keep in mind the the drop down is pretty much an UltraWebGrid, so here is how you would add values to it via code:

        Dim row As Infragistics.WebUI.UltraWebGrid.UltraGridRow
        For i As Integer = 0 To 10
            row = New Infragistics.WebUI.UltraWebGrid.UltraGridRow(New String() {String.Format("MyCell{0}", i)})
            Me.WebCombo1.Rows.Add(row)
        Next
0
 
Moizsaif123Author Commented:
cool.....One question though, how yu get the MyCell{0} to increment to MyCell{1}, MyCell{2}.....,  thanks again
0
 
liebrandCommented:
String.Format("MyCell{0}", i)

String.Format allows you to pass in multiple parameters that will be substituted in the string, so I passed in "i" which is from the loop.

Here is another example of String.Format:

string.format("Hello {0}, the date today is {1}. {0}, how may I assist you today?", "MyUsername", Date.Now())

the output would be:

"Hello MyUsername, the date today is 4/28/2004. MyUsername, how may I assist you today?"
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Moizsaif123Author Commented:
How do I set the Autopostback=true for the dropdownlistbox?



Moiz
0
 
Moizsaif123Author Commented:
sorry not dropdownlistbox, I meant the webcombo from the infragistics component...





Moiz
0
 
Moizsaif123Author Commented:
sorry again, Im thinking in terms of the old components of .NET. I double clicked and it went to the SelectedRowChanged event, thanks again



Moiz
0
 
Moizsaif123Author Commented:
hey liebrand, i want to use this logic and apply it to columns so instead of rows i want to add columns with increment of the i value. let me know if this is possible


Dim row As Infragistics.WebUI.UltraWebGrid.UltraGridRow
        For i As Integer = 0 To 10
        row = New Infragistics.WebUI.UltraWebGrid.UltraGridRow(New String() {String.Format("MyCell{0}", i)})
        Me.WebCombo1.Rows.Add(row)
Next


Moiz
0
 
Moizsaif123Author Commented:
sorry not to be too specific, I am talking about the ultrawebgrid not the webcombo.....




Moiz
0
 
liebrandCommented:
Open a new question...
0
All Courses

From novice to tech pro — start learning today.