データバインドされたRadioButtonListを含む列を持つGridViewコントロールがあります。 RBLはDataTableに正しくバインドされていますが、GridViewには表示されません。マークアップにListItemを追加すると、Labelコントロールが表示されます - 私はちょうどこれらの2つをテストとして実行しました。誰かが私が逃しているものを見ますか?任意の援助のためにデータバインドされたRadioButtonListバインディングがGridViewに表示される
TIA マイク
マークアップ:
<asp:TemplateField HeaderText="Preset Text" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:RadioButtonList ID="rblPresetText" runat="server" DataValueField="pKey" DataTextField="Contents" GroupName="PresetText" RepeatDirection="Vertical"></asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
は、分離コード:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
GlobalVar.LoadData(Session("UserPKey"))
Header1.ConnectionStr = GlobalVar.ConnectString
Header1.HDLawFirm = GlobalVar.LawFirmDir
If Page.IsPostBack = False Then
FillNotesDataSet()
BindNotesGrid()
BindPresetTextRadioButtonList()
End If
End Sub
Protected Sub BindPresetTextRadioButtonList()
Dim DAL As New DataAccessLayer
Dim dtPresetText As New DataTable
Dim rblPresetText As New RadioButtonList
dtPresetText = DAL.GetTextPickerTextForUser(Session("ClientKey"), Session("UserPKey"))
rblPresetText.DataSource = dtPresetText
rblPresetText.DataBind()
End Sub
あなたは 'dtPresetText'が空でないことを確認しましたか? – Andrei
はい、13行あり、私はバインディング後の直接ウィンドウのDDLから値を取得することさえできます。 – Mike