I have some issues with the WebHierarchicalDataGrid:
1) I'm having a NullReferenceException when i try to group by a column that has null values. How can i resolve this? Is there a way to set default values for the null elements?
2) I'm trying to hide a column when the grid is grouped by it but when i sort the column clicking the button at the group area the column is shown again. Can i control the javascript event of that kind of sorting? (I already control the event of sorting by clicking at the column header)
Thanks.
Hi fjVazquez,
I have managed to reproduce your first issue I believe. It happens on a postback after the grouping by the column with the null values happens. I have submitted it internally as bug 81188. If you contact Developer Support, you can have your case attached to this bug and be notified when a SR with the fix has been released.
As for your second issue. How are you trying to hide the columns? You will probably need to hide it on the band, but then copy the Hidden value from the band column to the grid level when the row island is created.
regards,
David Young
Thanks for your answer AgentD5.
Here is the code i'm using to hide the column:
<script type="text/javascript">
function changeGroup(e, f) {
var grid = $find("MyGrid");
var parentGrid = grid.get_gridView();
parentGrid.get_columns().get_columnFromKey(f.get_effectedColumn().get_columnKey()).set_hidden(hidden);
}
</script>
I call this function on the GroupedColumnsChanging client method.
Thanks for your answers. The code you put worked perfectly.
I added some code for ungrouping because when you ungroup a column it continued hidden.
protected void WebHierarchicalDataGrid1_GroupedColumnsChanging(object sender, GroupedColumnsChangingEventArgs e)
{
if (e.Action == GroupByChangeAction.Ungroup)
foreach (GroupedColumn col in e.EffectedColumns)
e.Band.Columns[col.ColumnKey].Hidden = false;
I've found another issue with the grids. When order a grid by a column (clicking at the column header or by method) the width of the grid columns is not fixed to the width of the grid (i have columns with the width value defined and columns without it). It happens with the explorer 8. In the explorer 9 seems to be fixed.
The only solution i see is to set the width value for all the columns but i have another problem. When i group by a column the grid messes up.
I have another error when i try to group by a column with the behavior columnfixing and AutoAdjustCells set to true.
This is a javascript error at the _onHorizontalScrollBarWidthInit function. "Can't obtain the value of the property 'get_element': the object is null or undefined" and another at the _gridViewCreated function. "The object doesn't allows the property or method '_get_bandFromAdr' "
I'm using version 10.3.20103.2120
Hi,
Column Fixing is not supported in the WHDG at this point in time. If you would like to see it so, please submit a feature request.
regards,David Young
Ok, thanks.