1. WebGrid only exposes styling for alternating rows - agree that jQuery could help here.
2. No, you can't customize the HTML. WebGrid is a simple helper for creating HTML tables.
3. ajaxUpdateContainerId enables async updates with jquery's .load. It needs the id for an element which contains the grid.
4. GetHtml combines the pager and table. Use Table/Pager separately if you don't want them combined automatically.
5. I believe   is the default for defaultCellValue. If your question is on empty rows - see fillEmptyRows arg for padding for the last page.
6. You can insert a custom column for a delete link or button. If you're using ajaxUpdateContainerId, you can use an ajax link as well. The grid should have helper methods for this... i.e., I think you can get an ajax row selection button like this:
WebGrid handles nulls when it formats the data - by replacing nulls with the defaultCellValue. If you provide a custom formatter, then you must handle the nulls yourself. In this case, it sounds like String.Format doesn't handle null values passed in.
Check for null first before calling; you can do it in a helper method if it's too verbose for inline.
chenriks
Member
198 Points
52 Posts
Microsoft
Re: WebGrid Stuff
Nov 18, 2010 09:31 PM|LINK
1. WebGrid only exposes styling for alternating rows - agree that jQuery could help here.
2. No, you can't customize the HTML. WebGrid is a simple helper for creating HTML tables.
3. ajaxUpdateContainerId enables async updates with jquery's .load. It needs the id for an element which contains the grid.
4. GetHtml combines the pager and table. Use Table/Pager separately if you don't want them combined automatically.
5. I believe   is the default for defaultCellValue. If your question is on empty rows - see fillEmptyRows arg for padding for the last page.
6. You can insert a custom column for a delete link or button. If you're using ajaxUpdateContainerId, you can use an ajax link as well. The grid should have helper methods for this... i.e., I think you can get an ajax row selection button like this:
grid.Column(format:@<input type="button" value="Select" onclick="@grid.GetContainerUpdateScript(item.GetSelectUrl())" />)
7. Columns have a style argument. Set the size via CSS.
ASP.NET Team
chenriks
Member
198 Points
52 Posts
Microsoft
Re: WebGrid Stuff.. ERROR
Nov 18, 2010 09:35 PM|LINK
WebGrid handles nulls when it formats the data - by replacing nulls with the defaultCellValue. If you provide a custom formatter, then you must handle the nulls yourself. In this case, it sounds like String.Format doesn't handle null values passed in. Check for null first before calling; you can do it in a helper method if it's too verbose for inline.
ASP.NET Team