datagrid inherited control lost design time settings

D

dma

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">&nbsp;<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>&nbsp;
<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>&nbsp;&nbsp;</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",
"divisiondetail.aspx?ID={0}") %>' Target="_blank">
</asp:HyperLink>
<asp:HyperLink id=HyperLink1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.ItemID") %>' NavigateUrl='<%#
DataBinder.Eval(Container, "DataItem.DivID",
"divisiondetail.aspx?ID={0}") %>' Target="_blank">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="DivName" SortExpression="DivName"
HeaderText="Division Name"></asp:BoundColumn>
<asp:BoundColumn DataField="DivAddress1"
SortExpression="DivAddress1" HeaderText="Division Address
1"></asp:BoundColumn>
<asp:BoundColumn DataField="DivAddress2"
SortExpression="DivAddress2" HeaderText="Division Address
2"></asp:BoundColumn>
<asp:BoundColumn DataField="DivCity" SortExpression="DivCity"
HeaderText="Division City"></asp:BoundColumn>
<asp:BoundColumn DataField="DivState" SortExpression="DivState"
HeaderText="Division State"></asp:BoundColumn>
<asp:BoundColumn DataField="DivZip" SortExpression="DivZip"
HeaderText="Division Zip"></asp:BoundColumn>
<asp:BoundColumn DataField="DivPhone" SortExpression="DivPhone"
HeaderText="Division Phone"></asp:BoundColumn>
<asp:BoundColumn DataField="DivFax" SortExpression="DivFax"
HeaderText="Division Fax"></asp:BoundColumn>
<asp:BoundColumn DataField="DivURL" SortExpression="DivURL"
HeaderText="Division URL"></asp:BoundColumn>
<asp:BoundColumn DataField="DivEmail" SortExpression="DivEmail"
HeaderText="Division Email"></asp:BoundColumn>
<asp:TemplateColumn SortExpression="Active" HeaderText="Active">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id=chkDispActive runat="server" Checked='<%#
Databinder.Eval(Container,"Dataitem.Active") %>' Enabled="False">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</sdg:sortdatagrid><BR>
<asp:label id="lblMsg" runat="server" Width="99%" BorderWidth="1px"
Font-Names="Verdana" Font-Size="Smaller"
BorderStyle="None" Visible="False" Height="24px" Font-Bold="True"
ForeColor="Red">Label</asp:label></form>
</body>
</HTML>

---------- Page codebehind
Imports ISNet.WebUI.WebCombo
Public Class divisionList
Inherits System.Web.UI.Page
Protected WithEvents cmdGo As System.Web.UI.WebControls.Button
Protected WithEvents dg As sortdatagrid.sortdatagrid
Protected WithEvents lblMsg As System.Web.UI.WebControls.Label
Protected WithEvents tblToolbar As
System.Web.UI.HtmlControls.HtmlTable
Protected WithEvents btnReset As System.Web.UI.WebControls.Button
Protected WithEvents txtFilter As
System.Web.UI.WebControls.TextBox
Protected WithEvents Hyperlink2 As
System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink1 As
System.Web.UI.WebControls.HyperLink
Protected WithEvents Sortdatagrid1 As sortdatagrid.sortdatagrid
Protected WithEvents Sortdatagrid2 As sortdatagrid.sortdatagrid
Protected WithEvents webcmbfilter As ISNet.WebUI.WebCombo.WebCombo
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents chkDispActive As
System.Web.UI.WebControls.CheckBox

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form
Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

' stuff removed
End Class

----------- control code
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient

Public Class sortdatagrid
Inherits System.Web.UI.WebControls.DataGrid
Public Sub New()
MyBase.New()
Me.AutoGenerateColumns = False
End Sub


Public Property SQLConnection() As String
Get
SQLConnection = viewstate("SQLConnection") 'SQLConnection
= m_sqlconn
End Get
Set(ByVal Value As String)
viewstate("SQLConnection") = Value 'm_sqlconn = Value
End Set
End Property
Public Property sqlbase() As String
Get
sqlbase = viewstate("sqlbase") 'sqlbase = m_SQLBase
End Get
Set(ByVal Value As String)
viewstate("sqlbase") = Value 'm_SQLBase = Value
End Set
End Property
Public Property tableName() As String
Get
tableName = viewstate("tablename") 'tableName =
m_tablename
End Get
Set(ByVal Value As String)
viewstate("tablename") = Value 'm_tablename = Value
End Set
End Property
Public Property searchcol() As String
Get
searchcol = viewstate("searchcol") 'searchcol =
m_searchcol
End Get
Set(ByVal Value As String)
viewstate("searchcol") = Value 'm_searchcol = Value
End Set
End Property
Public Property searchVal() As String
Get
searchVal = viewstate("searchval") 'searchVal =
m_searchVal
End Get
Set(ByVal Value As String)
viewstate("searchval") = Value ' m_searchVal = Value
End Set
End Property

Public Sub dg_SortCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs)
Handles MyBase.SortCommand

'removed
End Sub

Public Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
MyBase.PageIndexChanged 'Handles dg.PageIndexChanged
' End Sub

Public Function GetData() As DataTable
'
End Function


End Class
 
D

DMA

Ok... this misbehavior is happening with one of Dino Esposito's samples as well. Is this typical of a web control inherited from a datagrid, ie failing builders? I'm now wondering if it's somethign wrong with my development machine, so I'll probably load all of the tools on a spare box at work. Any insight would keep me from jumping out of my window shortly ;) thank

----- dma wrote: ----

Hi Al

I created a web user control inherited from a datagrid for sorting an
encapsulation. It rendered perfectly in design mode, and I could us
the property builder. I applied visual styles, got it all working
and today, for no apparent reason, The controls are rendering as plai
empty DG's, not showing my formatting, columns, etc. All of thes
settings are still in the HTML, but will not show in design mode, no
pull into the property builder. They run properly, however

Question: Can I use <asp:boundcolumn and other column directives on
grid inherited from a datagrid? I get a "the active schema does no
support the element <asp:boundcolumn> in design on the forum, in th
HTML

I'm not sure if I am missing something, but it is odd that this di
work, and now everywhere I reference my control, it fails. If I draw
new control using my custom control, it allows me to add columns to i
in design mode, but they are gone when I save and return to the form.
Here's the control code

<snip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top