I am using dropdownlist in webgrid.for loading the combo i am using this source code.
Expand|Select|Wrap|Line Numbers
- Dim vallist As New Infragistics.WebUI.UltraWebGrid.ValueList
- Dim ds As New DataSet
- ds = _Utility.runsql("select " + IDField + "," + TextField + " from " + TableName + " where Deleted=0")
- Dim dt As New DataTable
- dt.Columns.Add("unit_id")
- dt.Columns.Add("unit_name")
- If ds.Tables(0).Rows.Count > 0 Then
- dt.Rows.Add("", "")
- End If
- For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
- dt.Rows.Add(ds.Tables(0).Rows(i).Item(0).ToString, ds.Tables(0).Rows(i).Item(1).ToString)
- Next
- vallist.DataSource = dt
- vallist.DisplayMember = TextField
- vallist.DataMember = IDField
- vallist.ValueMember = IDField
- vallist.DataBind()
- Column.Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList
- Column.ValueList = vallist
How to solve this problem.Give solution for this.
Thanks in advance.