I have a grid with a GridTemplateColumn and GridBoundColumn. If the GridBoundColumn "username" is empty (has no value), I want the GridTemplateColumn checkbox should be disabled.
If I enter "If strxt = 'myname' " so does the example above work fine, but not if I specify "If strxt = ''" (emty)". I want all rows where the column "username" has no value / is empty, checkbox being disabled and is not going to click in.
Why it works only if I specify a value, not if it has no value?
<telerik:GridTemplateColumn DataField="cal_access" SortExpression="cal_access" UniqueName="cal_access" HeaderText="Ã…tkomst" HeaderButtonType="TextButton" HeaderStyle-Width="80px" AllowFiltering="False"> <ItemTemplate> <asp:HiddenField ID="hfCalAccess" Value='<%# DataBinder.Eval(Container.DataItem, "id")%>' runat="server" /> <asp:HiddenField ID="hfUsername" Value='<%# DataBinder.Eval(Container.DataItem, "username")%>' runat="server" /> <asp:CheckBox ID="cbCalAccess" AutoPostBack="true" OnCheckedChanged="CalAccess_CheckedChanged" Checked='<%# DataBinder.Eval(Container.DataItem, "cal_access") %>' runat="server" /> </ItemTemplate></telerik:GridTemplateColumn>Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) If TypeOf e.Item Is GridDataItem Then Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) Dim strxt As String = item("username").Text.ToString() If strxt = "myname" Then Dim chbx As CheckBox = DirectCast(item.FindControl("cbCalAccess"), CheckBox) chbx.Enabled = False End If End IfEnd SubIf I enter "If strxt = 'myname' " so does the example above work fine, but not if I specify "If strxt = ''" (emty)". I want all rows where the column "username" has no value / is empty, checkbox being disabled and is not going to click in.
Why it works only if I specify a value, not if it has no value?