Hey guys,
I have a super dupper ultra web grid on my project and I couldn't figure out how to notify the user that no results were found. Makes the user want to hit search again to make sure.
So the question is:
Is there a functionality on the UltraWebGrid similar to the EmptyDataTemplate on the GridView control?
Currently I have a label outside the UltraWebGrid and I check on the DataBound event if rows were returned. but I think I should use, if any, built in functionality to accomplish this.
Thanks !
Hello Iva,
NoDataMessage can accept HTML in addition to raw text, so you can try something along the lines of:
<DisplayLayout BorderCollapseDefault="Separate" Name="UltraWebGrid1" NoDataMessage="<span style='background-color:red'>No Data To Display Here</span>" RowHeightDefault="20px" Version="4.00">
OK, NoDataMessage property, I set the right message, but I realy don't like how it is look like.
Is there any css class that I can change to make it look nicer. I want to specify the background-color, padding and so on.
Please, help.
Iva
Ok that answers my question, thanks !!
The NoDataMessage probably isn't the best solution in this case. If I remember correctly, it only shows if the DataSource is null, but if you have columns defined, you won't see it, just the column Headers.
You are probably going to want to use an external HTML element of some sort, maybe position a Panel object on top of the grid, with the Z-index higher than the grid's zindex, and in the code behind if you detect > 0 rows, set the Panel to visibility none.
thanks for your quick reply !
I set the property and it didn't work, it didn't display anything, nada.
any ideas?