B
Ben
Hi,
The gridview contains a radiobuttonlist with boolean values (true/false)
coming from a database.
In normal mode, the gridview displays True or False for that field.
What i want is to change True' and 'False' by 'Yes' and 'No' in normal mode.
I tried this, but still get True / False.
Thanks for help
Ben
<asp:TemplateField>
<EditItemTemplate>
<asp:RadioButtonList ID="r1" SelectedValue='<%# Bind("myfield") %>'
runat="server">
</asp:RadioButtonList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label31" runat="server" Text='<%# Bind("myfield")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
------------------------------
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If e.Row.RowState And DataControlRowState.Normal =
DataControlRowState.Normal Then
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lb As Label
lb = CType(e.Row.FindControl("label31"), Label)
If lb.Text = "True" Then
lb.Text = "Yes"
Else
lb.Text = "No"
End If
End If
End If
The gridview contains a radiobuttonlist with boolean values (true/false)
coming from a database.
In normal mode, the gridview displays True or False for that field.
What i want is to change True' and 'False' by 'Yes' and 'No' in normal mode.
I tried this, but still get True / False.
Thanks for help
Ben
<asp:TemplateField>
<EditItemTemplate>
<asp:RadioButtonList ID="r1" SelectedValue='<%# Bind("myfield") %>'
runat="server">
</asp:RadioButtonList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label31" runat="server" Text='<%# Bind("myfield")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
------------------------------
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If e.Row.RowState And DataControlRowState.Normal =
DataControlRowState.Normal Then
If e.Row.RowType = DataControlRowType.DataRow Then
Dim lb As Label
lb = CType(e.Row.FindControl("label31"), Label)
If lb.Text = "True" Then
lb.Text = "Yes"
Else
lb.Text = "No"
End If
End If
End If