asp.net building controls:
Hi All
I created a web user control inherited from a datagrid for sorting and
encapsulation. It rendered perfectly in design mode, and I could use
the property builder. I applied visual styles, got it all working,
and today, for no apparent reason, The controls are rendering as plain
empty DG's, not showing my formatting, columns, etc. All of these
settings are still in the HTML, but will not show in design mode, nor
pull into the property builder. They run properly, however.
Question: Can I use <asp:boundcolumn and other column directives on a
grid inherited from a datagrid? I get a "the active schema does not
support the element <asp:boundcolumn> in design on the forum, in the
HTML.
I'm not sure if I am missing something, but it is odd that this did
work, and now everywhere I reference my control, it fails. If I draw a
new control using my custom control, it allows me to add columns to it
in design mode, but they are gone when I save and return to the form.
Here's the control code:
--------- ASPX form that uses the control HTML
<%@ Register TagPrefix="sdg" Namespace="sortdatagrid"
Assembly="febSortDG" %>
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="divisionlist.aspx.vb" Inherits="pts.divisionlist"
smartNavigation="True"%>
<%@ Register TagPrefix="iswebcombo" Namespace="ISNet.WebUI.WebCombo"
Assembly="ISNet.WebUI.WebCombo, Version=2.0.2500.14, Culture=neutral,
PublicKeyToken=c4184ef0d326354b" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Grade List</title>
<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="main.css" type="text/css" rel="stylesheet">
</HEAD>
<body bottomMargin="0" bgColor="#f5f5f5" leftMargin="0" topMargin="0"
rightMargin="0">
<form id="Form1" method="post" runat="server">
<table id="tblToolbar" style="HEIGHT: 10px" borderColor="#ffffff"
cellSpacing="0" cellPadding="1"
width="100%" align="center" bgColor="gainsboro"
borderColorLight="#ffffff" border="0"
runat="server">
<tr>
<TD style="WIDTH: 68px" align="center"><INPUT class="colorbutton"
id="btnNew" onclick="Javascript:window.open('divisiondetail.aspx')"
type="button" value="New..."></TD>
<TD style="WIDTH: 44px; HEIGHT: 31px" align="center">
<P align="right"><STRONG><FONT face="Verdana"
size="2">Filter</FONT></STRONG></P>
</TD>
<TD style="WIDTH: 177px; HEIGHT: 31px" align="center"
bgColor="gainsboro"><FONT><ISWEBCOMBO:WEBCOMBO id="webcmbfilter"
runat="server">
<LayoutSettings>
<MoreButtonOverStyle BorderWidth="1px"
BorderColor="LightSteelBlue" BorderStyle="Solid"
BackColor="#E9EBF4"></MoreButtonOverStyle>
<FrameOverStyle BorderWidth="1px" BorderColor="RoyalBlue"
BorderStyle="Solid" BackColor="#E9EBF4"></FrameOverStyle>
<SearchButtonStyle Width="16px" Cursor="Hand" Height="20px"
Font-Size="9pt" Font-Names="Webdings" ForeColor="#E9EBF4"
BackColor="#8080FF"></SearchButtonStyle>
<FrameStyle Width="200px" BorderWidth="1px"
BorderColor="#8080FF" BorderStyle="Solid"
BackColor="White"></FrameStyle>
<TextboxStyle Width="180px" BorderWidth="0px" Font-Size="8pt"
Font-Names="Verdana" BorderStyle="None"
ForeColor="Black" BackColor="Transparent"></TextboxStyle>
<SearchButtonOverStyle Cursor="Hand" Font-Size="9pt"
Font-Names="Webdings" ForeColor="#E9EBF4"
BackColor="RoyalBlue"></SearchButtonOverStyle>
<ResultBoxStyle Font-Size="8pt"
Font-Names="Verdana"></ResultBoxStyle>
<MoreButtonStyle BorderWidth="1px" BorderColor="White"
BorderStyle="Solid"></MoreButtonStyle>
<TextboxOverStyle BorderWidth="0px" Font-Size="8pt"
Font-Names="Verdana" BorderStyle="None"
BackColor="Transparent"></TextboxOverStyle>
<StatusBoxStyle Font-Size="8pt" Font-Names="Verdana"
ForeColor="White" BackColor="LightSteelBlue"></StatusBoxStyle>
<SelectedRowStyle Font-Size="8pt" Font-Names="Verdana"
ForeColor="White" BackColor="Navy" CustomRules="height:
20px"></SelectedRowStyle>
<RowStyle CustomRules="height: 20px"></RowStyle>
<ResultFrameStyle BorderWidth="1px" BorderColor="RoyalBlue"
BorderStyle="Solid"></ResultFrameStyle>
<ColumnStyle CustomRules="text-overflow: ellipsis; overflow:
hidden;"></ColumnStyle>
</LayoutSettings>
<Columns>
<iswebcombo:Column Name="Column0" Bound="False"
Width=""></iswebcombo:Column>
</Columns>
</ISWEBCOMBO:WEBCOMBO></FONT></TD>
<TD style="WIDTH: 70px; HEIGHT: 31px" align="center"
bgColor="#dcdcdc"><FONT style="BACKGROUND-COLOR:
gainsboro"> <STRONG><FONT face="Verdana" size="2">for
text </FONT></STRONG></FONT>
</TD>
<TD style="WIDTH: 288px" align="center"
bgColor="#dcdcdc"><FONT><asp:textbox id="txtFilter"
runat="server"></asp:textbox>
<asp:button id="cmdGo" runat="server" Width="51px" Text="Go"
CssClass="colorbutton"
DESIGNTIMEDRAGDROP="112"></asp:button><asp:button id="btnReset"
runat="server" Width="51px" Text="Reset"
CssClass="colorbutton"></asp:button></FONT></TD>
<td align="center" bgColor="gainsboro"><FONT face="Verdana"
size="2"><STRONG> </STRONG></FONT></td>
</tr>
</table>
<FONT face="Verdana" color="white" size="2"></FONT>
<sdg:sortdatagrid id="dg" runat="server" Width="99%"
FooterStyle-BackColor="#ffffcc" HorizontalAlign="Center"
CellPadding="1" BackColor="White" BorderWidth="1px"
BorderColor="#E7E7FF" pagesize="20" autogeneratecolumns="False"
allowsorting="True" Font-Names="Verdana" Font-Size="Smaller"
BorderStyle="None" AllowPaging="True">
<PagerStyle HorizontalAlign="Right" ForeColor="#4A3C8C"
Position="TopAndBottom" BackColor="#E7E7FF"
PageButtonCount="20" Mode="NumericPages"></PagerStyle>
<AlternatingItemStyle Wrap="False"
BackColor="#F7F7F7"></AlternatingItemStyle>
<EditItemStyle Wrap="False"></EditItemStyle>
<FooterStyle BackColor="#FFFFCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" BorderWidth="1px"
ForeColor="#F7F7F7" BorderStyle="Solid"
BackColor="#738A9C"></SelectedItemStyle>
<ItemStyle Wrap="False" Height="20px" ForeColor="#4A3C8C"
BackColor="#E7E7FF"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"
Height="30px" ForeColor="#F7F7F7" BackColor="#4A3C8C"></HeaderStyle>
<Columns>
<asp:TemplateColumn SortExpression="DivID" HeaderText="Division
ID">
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:HyperLink id=Hyperlink2 runat="server" Text="<img
src='images/edit.gif' border='0'>" NavigateUrl='<%#
DataBinder.Eval(Container, "DataItem.DivID",