Link to home
Start Free TrialLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

UltraWebgrid

In Infragistics, 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 for an ultrawebgrid.


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
Avatar of liebrand
liebrand
Flag of United States of America image

       For i As Integer = 0 To 3
            Dim column As New Infragistics.WebUI.UltraWebGrid.UltraGridColumn
            column.Key = String.Format("column{0}", i)
            column.HeaderText = String.Format("Column{0}", i)
            WebCombo1.Columns.Add(column)
        Next

        Dim row As Infragistics.WebUI.UltraWebGrid.UltraGridRow
        For i As Integer = 0 To 10
            row = New Infragistics.WebUI.UltraWebGrid.UltraGridRow

            Dim cell As Infragistics.WebUI.UltraWebGrid.UltraGridCell
            For x As Integer = 0 To 3
                cell = New Infragistics.WebUI.UltraWebGrid.UltraGridCell
                cell.Text = String.Format("Cell {0}:{1}", i, x)
                row.Cells.Add(cell)
            Next

            Me.WebCombo1.Rows.Add(row)
        Next
Avatar of Moiz Saifuddin
Moiz Saifuddin

ASKER

WebCombo1.Columns.Add(column), I dont want to add it to a webcombo, I want to add it to my ultrawebgrid itself, do i just say UltraWebGrid1.Columns.add(column) ?



Moiz

ASKER CERTIFIED SOLUTION
Avatar of liebrand
liebrand
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I added that by mistake earlier in my code

Me.WebCombo1.Rows.Add(row)
 
I am only talking about the webgrid, nothing to do with the combo, i was trying to add columns on the webgrid on runtime....


moiz
i wanted to rename my columns as they increment, nothing to do with the webcombo, and it worked.... as time1,time2,time3,time4.......time(n)

Dim nRow as integer
For nRow = 1 To DataGrid2.Columns.Count - 1
            DataGrid2.Columns(nRow).Key = String.Format("time{0}", nRow)
            DataGrid2.Columns(nRow).HeaderText = String.Format("time{0}", nRow)
Next



Moiz
i still dont know what the word, Key means??




Moiz