We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

GridWeb Checkbox

We are having a problem using the checkbox on the GridWeb (Lastest version - 2.3.1.2000)

We are displaying Boolean data and the checkboxes display on/off corretly when displayed. However, if users does a postback on the grid using a CustomCommandButton (other actions may also cause issue). Any visual checkbox changes are lost to the user. The actual value is still correct, but it is displayed wrong.

I have created a very simple test project which shows the issue and some screenshots of the incorrect behaviour.

On another minor note. Can you use the keyboard to select check and uncheck the checkbox. If you click into the checkbox the space bar does work. But you have to click first. We want to just use keyboard. With a normal text field on a gird you can enter data by typing which overwrites any previously entered data. But if you click in the field with the mouse you can edit the value. Can you do this action with the keyboard?

Hi Kris,

Please use the code given below. Using this code, the GridWeb will work in the desired way.

Furthermore, We are looking into the possibilies for issue of using Keyboard only with the GridWeb. We will update you as soon as we find any solution.

Code Snippet:
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
CreateGridItems();
grid1.WebWorksheets[0].DataSource = GridItems;
grid1.WebWorksheets[0].DataBind();
}

}


private void CreateGridItems()
{
GridItems = new List();
TestClass class1 = new TestClass("Test1", false, Convert.ToDecimal(100.00));
GridItems.Add(class1);
TestClass class2 = new TestClass("Test2", true, Convert.ToDecimal(200));
GridItems.Add(class2);
TestClass class3 = new TestClass("Test3", true, Convert.ToDecimal(300.581212));
GridItems.Add(class3);
TestClass class4 = new TestClass("Test4", false, Convert.ToDecimal(299.9112122));
GridItems.Add(class4);
}

protected void grid1_CustomCommand(object sender, string command)
{
if (command == "ADDREC")
{
grid1.WebWorksheets[0].CreateNewBindRow();
}
}

protected void grid1_Load(object sender, EventArgs e)
{
CustomCommandButton ccb;
grid1.CustomCommandButtons.Clear();

ccb = new CustomCommandButton();
ccb.Command = "ADDREC";
ccb.ToolTip = "Add row";
grid1.CustomCommandButtons.Add(ccb);
}


public class TestClass
{
private string sDescription;
private bool bFlag;
private decimal dValue;

public TestClass()
{
}

public string Description
{
get { return sDescription; }
set { sDescription = value; }
}

public bool Flag
{
get { return bFlag; }
set { bFlag = value; }
}

public decimal Value
{
get { return dValue; }
set { dValue = value; }
}

public TestClass(string pDescription, bool pFlag, decimal pValue)
{
Description = pDescription;
Flag = pFlag;
Value = pValue;

}
}


Please add this following line of code into the web.config file under assemblies section:


Thanks,

I have copied all the code (although I don't see that there are any actual changes) and added the assembly line to our web.config file.

I still have the exact same issue.

The only change in the code you sent is the new reference in the web.config file. Am I missing something?

Hi,

We found you set the “NumberType” attribute to “General” in “Flag” BindColumn. Please modify it to “General”. The checkbox issue should not be reproduced.

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>

And, to check or uncheck checkbox via spacebar key at client side is supported in Aspose.Cell.GridWeb v2.3.2.2001 (attached).

In this fix, for your knowledge, some properties are obsolete, so may adjust your codes accordingly.

1) The properties of NumberType, Custom and IsLocked in Aspose.Cells.GridWeb.Data.WebCell are obsolete. These properties are added into Aspose.Cells.GridWeb.TableItemStyle.Style.

2) The property of Style in Aspose.Cells.GridWeb.Data.WebCell is obsolete. The recommended alternatives methods are Aspose.Cells.GridWeb.Data.WebCell.GetStyle() and SetStyle().

Thank you.