Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
312
ultrawebgrid+dropdownlist
posted

 How can i fill a bulk of data in a dropdown list in ultrawebgrid.i want to fill it from my database table using sqldatasource. when iam trying to fill it my grid is not working .i cant do anything inside it .i want to fill the name of countries in my dropdownlist.

  • 470
    posted

    This is way too late for you but maybe it helps someone else.

    Apparently ther is no DIRECT way to fill a dropdownlist in an UltraWebGrid from an SQLDataSource. You can fill it with a little code..

    Assume I have a column with Key= "Answer_ID" which will hold a code. I want my dropdown to display the associated description for that code. The code and description are in an SQL table. My SQLDataSource1 pulls the appropriate rows and columns.

    (make sure you import Ultrawebgrid..)

    Imports 

     

    Infragistics.WebUI.UltraWebGrid

    Then in page load..

     

     

     

     

     

     

     

     

     

     

    Dim AnswerValueList As New ValueList(True)

     

     

     

     

    Dim Answers As DataView = CType(Me.SQLDatasource1.Select(DataSourceSelectArguments.Empty), DataView)

     

     

    For rowcounter As Int16 = 0 To Answers.Table.Rows.Count - 1

    AnswervalueList.ValueListItems.Add(Answers.Table.Rows(rowcounter)(0), Answers.Table.Rows(rowcounter)(1))

     

     

    Next

    AnswerValueList.DisplayStyle = ValueListDisplayStyle.DisplayText

     

     

    Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns.FromKey("Answer_ID").Type = ColumnType.DropDownList

     

     

    Me.UltraWebGrid1.DisplayLayout.CellClickActionDefault = CellClickAction.Edit

     

     

    Me.UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.Yes

     

     

    Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns.FromKey("Answer_ID").ValueList = AnswerValueList