Customize RowChecker - Error occurs in the header

11 replies. Last post: February 2, 2010 2:15 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Yuting ZhuMember

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;
            }
        }
    }

 

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;
            }
        }
    }

 

 

1 attachment
All times are GMT -5. The time now is 3:28 AM.
Previous Next