View Full Version : [CLOSED] Trouble setting checkbox from code behind to checked

Sep 06, 2013, 9:03 AM

It looks so simple that I am sure that I overlooked something important but I can't find it and it is bugging me for days without having found a solution on the web.

I just want to get that checkbox checked through code behind.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demo.aspx.cs" Inherits="demo" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<form id="Form" runat="server">

<ext:ResourceManager ID="ResourceManager" runat="server" />

<ext:Button runat ="server" OnClientClick="App.direct.onButtonClick()" Text="Open window" />


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

public partial class demo : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
if (!X.IsAjaxRequest)


// On button click open window with checked checkbox
public void onButtonClick()
Window win = new Window
Title = "Demo",
Items = { new Checkbox { FieldLabel = "checkbox", Checked = true } }


Thank you very much.

Sep 06, 2013, 11:32 AM
Hi @tMp,

Yes, that is a known problem.

Please set up this setting for the Checkbox to get rid off the problem.

IsDynamic = true

Sep 06, 2013, 1:38 PM
Thank you. Working perfectly like this. Sorry that I didn't find this myself.

Sep 06, 2013, 2:07 PM
You are good. When I faced this issue first time, I spent quite a lot of time to sort it out. Ideally, it should not require that IsDynamic setting, but we were unable to come up with better solution.