hi All,
I have a dropdown (programgroup) in my edit form for which I want to set the selectedvalue in the code behind and not in aspx. For that I have to know the value that is in the radgrid cell for that column. Please see the code below. I have a different datakey and this program group cannot be the datakey.
This is my aspx definition:
In MasterTable View:
<telerik:GridBoundColumn UniqueName="ProgramGroup" HeaderText="Program Group" DataField="ProgramGroup" DefaultInsertValue=""> </telerik:GridBoundColumn>
In the EditForm Template:
<asp:DropDownList ID = "ddlProgramGroup" runat = "server" TabIndex="8" Width="200px" DataTextField = "List_Item" DataValueField = "List_Value" DataSource ="<%# dsProgramGroup(true) %>" >
</asp:DropDownList>
In the CodeBehind:
Private Sub rgSearchResults_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgSearchResults.ItemDataBound
If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
Dim ddlDropDownList As DropDownList = DirectCast(e.Item.FindControl("ddlProgramGroup"), DropDownList)
If Not IsNothing(ddlDropDownList) Then
Dim strPrg As String = "VALUE IN THE RADGRID CELL"
ddlDropDownList.Items.FindByText(strPrg).Selected = True
End If
End If
End Sub
Is there a way to find out the value of the program group is the radgrid_ItemDataBound event
I have a dropdown (programgroup) in my edit form for which I want to set the selectedvalue in the code behind and not in aspx. For that I have to know the value that is in the radgrid cell for that column. Please see the code below. I have a different datakey and this program group cannot be the datakey.
This is my aspx definition:
In MasterTable View:
<telerik:GridBoundColumn UniqueName="ProgramGroup" HeaderText="Program Group" DataField="ProgramGroup" DefaultInsertValue=""> </telerik:GridBoundColumn>
In the EditForm Template:
<asp:DropDownList ID = "ddlProgramGroup" runat = "server" TabIndex="8" Width="200px" DataTextField = "List_Item" DataValueField = "List_Value" DataSource ="<%# dsProgramGroup(true) %>" >
</asp:DropDownList>
In the CodeBehind:
Private Sub rgSearchResults_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles rgSearchResults.ItemDataBound
If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
Dim item As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
Dim ddlDropDownList As DropDownList = DirectCast(e.Item.FindControl("ddlProgramGroup"), DropDownList)
If Not IsNothing(ddlDropDownList) Then
Dim strPrg As String = "VALUE IN THE RADGRID CELL"
ddlDropDownList.Items.FindByText(strPrg).Selected = True
End If
End If
End Sub
Is there a way to find out the value of the program group is the radgrid_ItemDataBound event