Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1568
  • Last Modified:

WebCombo

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



Moiz
0
Moizsaif123
Asked:
Moizsaif123
  • 7
  • 3
1 Solution
 
liebrandCommented:
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now