I am trying to fill a drop down list witht he value of the textbox from the radgrid. I tire a previous example sent to me but keep getting Object not set to reference.
Protected Sub myRadGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGrid.ItemDataBound
If TypeOf e.Item Is GridDataItem Then
Dim gr As DropDownList = CType(e.Item.FindControl("ddlRank"), DropDownList)
Dim rank As String = e.Item.Cells(6).Text
sql = "Select * from OPENQUERY(SIDPERS, 'Select Distinct PAY_GR, PAY_GR GR from PERS_GRABBR_CODE_TBL ORDER BY PAY_GR')"
myDataTable = New DataTable
myDataTable = getData(sql)
gr.DataSource = myDataTable
gr.DataTextField = "GR"
gr.DataValueField = "PAY_GR"
gr.SelectedValue = DirectCast(DataBinder.Eval(e.Item.DataItem, rank).ToString(), String)
gr.DataBind()
End If
End Sub
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
table
width
=
"100%"
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Prior Uic: </
td
>
<
td
style
=
"width:50%"
align
=
"left"
><
asp:TextBox
ID
=
"txtPriorUic"
runat
=
"server"
Width
=
"100px"
Text='<%# Bind("strPrevUic") %>'></
asp:TextBox
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Para: </
td
>
<
td
style
=
"width:50%"
align
=
"left"
"><
asp:TextBox
ID
=
"txtpara"
runat
=
"server"
Width
=
"100px"
Text='<%# Bind("strPara") %>'></
asp:TextBox
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
> Line: </
td
>
<
td
style
=
"width:50%"
align
=
"left"
><
asp:TextBox
ID
=
"txtLine"
runat
=
"server"
Width
=
"100px"
Text='<%# Bind("strLine") %>'></
asp:TextBox
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"height:5px"
></
td
>
</
tr
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
>Return Grade: </
td
>
<
td
style
=
"width:50%"
align
=
"left"
><
asp:DropDownList
ID
=
"ddlRank"
runat
=
"server"
Width
=
"105px"
> </
asp:DropDownList
>
</
td
>
</
tr
>
</
table
>
<
table
width
=
"100%"
>
<
tr
>
<
td
style
=
"width:50%"
align
=
"right"
></
td
>
<
td
style
=
"width:50%"
align
=
"left"
>
<
asp:LinkButton
ID
=
"lnkSubmit"
runat
=
"server"
text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></
asp:LinkButton
>
<
asp:LinkButton
ID
=
"lnkCancel"
runat
=
"server"
CausesValidation
=
"false"
CommandName
=
"Cancel"
Text
=
"Cancel"
></
asp:LinkButton
>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>