iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I am using the RowChecker in a form. Not every row can be selectable, so I set the IsRowChecker to false for that column in that row use the following code.
But the CheckBox in the header won’t work and got the javascript error "'tagName' is null or not an object" in the attachment. Is there a way to make the header CheckBox work? If not, can I hide the header checkbox?
Thanks!
protected void _webGrid_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { if (e.Row.Type == RowType.Record) { WebGridColumn editColumn = e.Row.Table.Columns.GetNamedItem("EditColumn"); string reviewID = e.Row.KeyValue.ToString(); string ownerID = (string)((DataRowView)e.Row.DataRow).Row["OwnerID"]; WebGridCell selectedRowCell = e.Row.Cells.GetNamedItem("SelectedRow"); WebGridColumn selectedRowColumn = e.Row.Table.Columns.GetNamedItem("SelectedRow"); if (new Guid(reviewID) != Guid.Empty && ownerID == _employeeID) { selectedRowColumn.IsRowChecker = true; //selectedRowColumn.ColumnType = ColumnType.CheckBox; } else { e.Row.ForceNoEdit = true; selectedRowColumn.IsRowChecker = false; //selectedRowColumn.ColumnType = ColumnType.Text;//.EditType = EditType.NoEdit; //selectedRowCell.ForceNoEdit = true; } } }
Our developer teams have fixed the issue. The fix would be available in the next hotfix release. Btw, In server-side, you should not use RootTable.Rows when the Grid is grouped, because the Rows is already grouped and thus contain group structure (not plain rows).
If you want to get the raw count of the rows regardless of group, use GetUngrouppedRows().Count.
Regards,Handy
Hi,
I am not sure how to replicate your issue. But if you want to disable checkbox header and the cell, you will need to get the element and set disable= true. I attached my sample for you. Hope this is what you are looking for.
On your sample, you make the checkbox on each row disabled but if you click on the header checkbox, every row checkbox will become selected. That is not what I wanted. I don't want the disabled row be selectable. I modified your InitializeRow as below, it shows the way I wanted. But when you click on the header checkbox, you'll get the javascript error. Screenshot is attached.
Is there a way to make the header CheckBox to only select thoes selectable rows? If not, how can I hide or disable the header checkbox when the page is load?
Thanks,
Yuting
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e) { //e.Row.Cells[0].ForceNoEdit = true; if (e.Row.Cells[2].Text == "ANATR" || e.Row.Cells[2].Text == "AROUT") { e.Row.Table.Columns[0].IsRowChecker = false; e.Row.ForceNoEdit = true; } else { e.Row.Table.Columns[0].IsRowChecker = true; e.Row.ForceNoEdit = false; } }
Hello,
You got error because you discard IsRowChecker at cells level while IsRowChecker at header column needs to check/uncheck IsRowChecker at cells level. I attached a new sample about your requirement. Hope this helps.
You hard code the row number in your sample to uncheck the rowchecker. But I have to set the ForceToEdit = false in the server for more complax condition. I then have to use a for loop to check if the cell is disabled on the client to uncheck it. It works fine only when there are no too many rows since each row calls the for loop. Is there a way to get the row object directly in this situation?
When there is a GroupColumn, wg.RootTable.GetRowsCount() returns 0 in the WebGrid1_OnCheckBoxClick. How can I fix that?
The attached is a sample.
wg.RootTable.GetRowsCount() does not return 0. The error is located at wg.RootTable.GetRow(i) which is null. In group mode, the structure is changed. Please let me know what your scenario when in grouping mode.
After set ColumnFooters="Yes" GroupTotalVisible="True", wg.RootTable.GetRowsCount() returns 0. The attached is a sample that shows my scenario. Please check the DisableCheckBox page.
Handy, have you figured out a way to do this?
I can replicate the issue now. There is only one properties that made different result.
GroupTotalVisible="true"If I don't use this properties at roottable level, i don't get 0 value but i will get javascript error.While on your scenario, you used this properties and will always return 0 (without error).
This regression issue has been forwarded to our developer teams and they will fix this soon.
The error "wg.RootTable.GetRow(i) is null" occurs as long as there is a group column. The reason you don't see the error when GroupTotalVisible = true, is that wg.RootTable.GetRow(i) is never got called since the rowscount is 0. Just want to make sure the issue "wg.RootTable.GetRow(i) is null" when there is a group column need to be fixed as well.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname