mathieu_cupryk
asked on
DAtagrid Paging Setting up.
I have the following code:
tbparameters
  CM_REF PM_NAME       PM_TYPE PM_DIRECTION  PM_LENGTH PM_CONTENT                      PM_INDEX PM_DESCRIPTION
---------- --------------- ---------- ------------ ---------- -------------------------- ---------- ---------- ---- ---------- -------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------
     1 pm_ServNb         8       1      8                               1 Input service number
     2 pm_AccNB         8       1     12                               1 Input account number
     3 pm_LastName        8       1     50                               1 Input last name
     5 pm_Username        8       1     32                               1 Username field
     4 pm_FirstName       8       1     50                               1 Input first name
     5 pm_Password        8       1     40                               2 Password field
     6 pm_PaymNb         8       1     10                               1 Payment number field
     6 pm_CashNb         8       1      8                               2 Cashier number field
     6 pm_Date          8       1     19                               3 Receipt date field
     6 pm_Data          8       1    2500                               4 Receipt data
     7 pm_PaymNb         8       1     10                               1 Payment number field for tbreceipts
I am missing something. It basically does not tell me there is no page 2. I cannot figure the problem out.
<%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logou t.ascx" %>
<%@ import namespace="System.Web.UI" %>
<%@ import namespace="System.Web.Sess ionState" %>
<%@ import namespace="System.Web" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.Componen tModel" %>
<%@ import namespace="System.Collecti ons" %>
<%@ import namespace="System.Text" %>
<%@ import namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odb c" %>
<%@ Register TagPrefix="mspos" TagName="header" Src="Engine/Controls/heade r.ascx" %>
<%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/foo ter.ascx" %>
<HTML>
<HEAD>
<title>Users Interface to Managing Adminitrators</title>
<meta content="True" name="vs_snapToGrid">
<script language="C#" runat="server">
private DataSet ddlDataSet = new DataSet();
private OdbcConnection myConnection = Â new OdbcConnection("DSN=MSPOS; UID=system ;PWD=syste m");
private DataSet ddlDataSet1 = new DataSet();
private DataSet ddlDataSet2 = new DataSet();
private string CommandID; Â Â Â Â Â Â Â Â Â Â Â
//************************ ********** ********** ********** ********** *****
// Get TBDATATYPE and populate dataset with DT_REF and DT_DESCRIPTION Â
public DataSet BindTBDATATYPE()
{
           OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS; UID=system ;PWD=syste m");
           // Populate the ddlDataSet1
           myConnection.Open();
           const string strSQLDDL = @"SELECT DT_REF, DT_DESCRIPTION FROM TBDATATYPE ORDER BY DT_REF";
           OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
           ddlDataSet1.Clear(); Â
           myDataAdapter.Fill(ddlData Set1, "ddlDATATYPE");
           myDataAdapter.Dispose();
           myDataAdapter = null;
           myConnection.Close();
           return ddlDataSet1;
}
//************************ ********** ********** ********** ********** *******
//************************ ********** ********** ********** ********** *******
// Get TBPARAMDIRECTION and populate dataset with PD_REF and PD_DESCRIPTION
public DataSet BindTBPARAMDIRECTION()
{
           OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS; UID=system ;PWD=syste m");
           // Populate the ddlDataSet2
           myConnection.Open();
           const string strSQLDDL = @"SELECT PD_REF, PD_DESCRIPTION FROM TBPARAMDIRECTION ORDER BY PD_REF";
           OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
           ddlDataSet2.Clear(); Â
           myDataAdapter.Fill(ddlData Set2, "ddlPARAMDIRECTION");
           myDataAdapter.Dispose();
           myDataAdapter = null;
           myConnection.Close();
           return ddlDataSet2;
}
//************************ ********** ********** ********** ********** *******
Â
//************************ ********** ********** ********** **********
protected void Page_Load(object sender, System.EventArgs e)
{
      if (!Page.IsPostBack)
      {
           BindData();
      }
}
//************************ ********** ********** ********** **********
//************************ ********** ********** ********** **********
private void BindData()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS; UID=system ;PWD=syste m");
  myConnection.Open();
      Â
  // get records from the table
  string commandString = @"SELECT GET_DT_TBDATATYPE(PM_TYPE) AS TYPENAME, GET_PD_TBPARAMDIRECTION(PM _DIRECTION ) AS DIRECTIONNAME, CM_REF, PM_INDEX, PM_NAME, PM_DESCRIPTION, PM_TYPE AS DT_REF, PM_CONTENT, PM_DIRECTION AS PD_REF, PM_LENGTH  FROM TBPARAMETERS ORDER BY CM_REF";     Â
      // Set the datagrid's datasource to the datareader and databind
  // Create a OdbcCommand object and assign the connection connect to the database
  OdbcCommand command = myConnection.CreateCommand ( );
  command.CommandText = commandString;
  command.Connection = myConnection;
      // Create the Reader and bind it to the datagrid
  OdbcDataReader reader =  command.ExecuteReader(Comm andBehavio r.CloseCon nection);
  DataGridUserManagementID.D ataSource= reader;
  DataGridUserManagementID.D ataBind();
      reader.Close();
      reader=null;
  myConnection.Dispose();
      myConnection.Close();
       Â
}
//************************ ********** ********** ********** **********
//************************ ********** ********** ********** ******
private void DataGridUserManagementID_S electedInd exChanged( object sender, System.EventArgs e)
{
      int intCount;
      for (intCount = 1; intCount <= DataGridUserManagementID.I tems.Count ; intCount ++)
        DataGridUserManagementID.I tems[intCo unt - 1].BorderStyle =  BorderStyle.Groove;
      DataGridUserManagementID.S electedIte m.BorderSt yle = BorderStyle.Dashed;
}
//************************ ********** ********** ********** ******
//************************ ********** ********** ********** **********
private void DataGridUserManagementID_D elete(obje ct source,
System.Web.UI.WebControls. DataGridCo mmandEvent Args e)
{
 Â
 // Get the CommandID of the row whose Delete button was clicked
  string strCommandID = ((Label)e.Item.FindControl ("lblComma ndID")).Te xt;
  int SelectedCommandID = Convert.ToInt32(strCommand ID);
  string strSQL = "Delete from TBPARAMETERS where CM_REF ='"+ SelectedCommandID +"'";
  ExecuteQuery(strSQL);
  Â
  DataGridUserManagementID.E ditItemInd ex = -1;
  BindData();
}
//************************ ********** ********** ********** **********
//************************ ********** ********** ********** *********
private int ExecuteQuery(string sqlCmd)
{
  // Create a OdbcCommand object and assign the connection connect to the database
  OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS; UID=system ;PWD=syste m");
  myConnection.Open();
  OdbcCommand command = myConnection.CreateCommand ( );
  command.CommandText = sqlCmd;
  command.Connection = myConnection;
  return command.ExecuteNonQuery();
}
//************************ ********** ********** ********** *********
//************************ ********** ********** ********** *********
private void DataGridUserManagementID_U pdate(obje ct source,
System.Web.UI.WebControls. DataGridCo mmandEvent Args e)
{
  // Determine what store was selected
  string strTypeID, strType, strDirectionID, strDirection;
  string cmd;
      string CommandID, strCommandID, strDescription, strName, strTimeout, strContent, strLength;  Â
  ///... declarations for remaining data fields
  CommandID = Session["CommandID"].ToStr ing();
      strCommandID = ((TextBox)e.Item.FindContr ol("editCo mmandID")) .Text;
  strDescription = ((TextBox)e.Item.FindContr ol("editDe scription" )).Text;
  strName = ((TextBox)e.Item.FindContr ol("editNa me")).Text ;
      strContent = ((TextBox)e.Item.FindContr ol("editCo ntent")).T ext;
      strLength = ((TextBox)e.Item.FindContr ol("editLe ngth")).Te xt;
  strTypeID = ((DropDownList)(e.Item.Fin dControl(" ddlDATATYP E"))).Sele ctedItem.V alue;
       strType = ((DropDownList)(e.Item.Fin dControl(" ddlDATATYP E"))).Sele ctedItem.T ext;
  strDirectionID = ((DropDownList)(e.Item.Fin dControl(" ddlPARAMDI RECTION")) ).Selected Item.Value ;
  strDirection = ((DropDownList)(e.Item.Fin dControl(" ddlPARAMDI RECTION")) ).Selected Item.Text;
     Â
 Â
      // form the update statement
  // connect to the database
  if (e.CommandName == "Update")  Â
      {
           string strsql;
          Â
           if (CommandID != strCommandID)
                 cmd = "Update TBPARAMETERS Set CM_REF='"+ strCommandID +"', PM_NAME ='"+ strName +"', PM_TYPE ='"+ strTypeID +"', PM_DIRECTION = '"+ strDirectionID +"', PM_LENGTH='"+ strLength +"', PM_CONTENT='"+ strTypeID +"', PM_INDEX='"+ strDirectionID +"', PM_DESCRIPTION='"+ strDescription +"' Where CM_REF = "+ CommandID +"";
             else
                  cmd = "Update TBPARAMETERS Set CM_REF='"+ CommandID +"', PM_NAME ='"+ strName +"', PM_TYPE ='"+ strTypeID +"', PM_DIRECTION = '"+ strDirectionID +"', PM_LENGTH='"+ strLength +"', PM_CONTENT='"+ strTypeID +"', PM_INDEX='"+ strDirectionID +"', PM_DESCRIPTION='"+ strDescription +"' Where CM_REF = "+ strCommandID +"";
        Â
         ExecuteQuery(cmd);
            strsql = null;
            Session["CommandID"] = null;
      }
       DataGridUserManagementID.E ditItemInd ex = -1;
  BindData(  );
 Â
}
//************************ ********** ********** ********** ********** ********
//************************ ********** ********** ********** **********
private void DataGridUserManagementID_E dit(object source,
System.Web.UI.WebControls. DataGridCo mmandEvent Args e)
{
      CommandID = ((Label)e.Item.FindControl ("lblComma ndID")).Te xt;
  Session["CommandID"] = CommandID;
      DataGridUserManagementID.E ditItemInd ex = e.Item.ItemIndex;
  BindData();
}
//************************ ********** ********** ********** **********
//************************ ********** ********** ********** **********
private void dg_Page(object source, DataGridPageChangedEventAr gs e)
{
      DataGridUserManagementID.C urrentPage Index = e.NewPageIndex;
  BindData();
}
//************************ ********** ********** ********** **********
//************************ ********** ********** ********** ********** ********
protected void DataGridUserManagementID_I temCreated (Object sender, DataGridItemEventArgs e)
{
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingIt em || e.Item.ItemType == ListItemType.EditItem)
      {
           ImageButton btn = (ImageButton)e.Item.FindCo ntrol("btn Del");
        btn.Attributes.Add("onclic k", "return confirm('Are you sure you want to delete this item.')");
      }
}
//************************ ********** ********** ********** ********** ********
//************************ ********** ********** ********** ********** ********** ****
private void DataGridUserManagementID_I temDataBou nd(object sender,
System.Web.UI.WebControls. DataGridIt emEventArg s e)
{
  ListItemType oType = ((ListItemType)e.Item.Item Type);
  if(oType == ListItemType.Item || oType == ListItemType.AlternatingIt em)
  {
           e.Item.Attributes.Add("onm ouseover", "this.style.backgroundColo r='lightbl ue'");      Â
           e.Item.Attributes.Add("onm ouseout", "this.style.backgroundColo r='Beige'" );      Â
      }
     Â
      if ((oType == ListItemType.EditItem))
  {
      Â
    DropDownList listType =((DropDownList)e.Item.Fin dControl(" ddlDATATYP E"));
        listType.SelectedIndex = listType.Items.IndexOf(lis tType.Item s.FindByTe xt(Convert .ToString( DataBinder .Eval(e.It em.DataIte m,"TYPENAM E"))));
            Â
        DropDownList listDirection =((DropDownList)e.Item.Fin dControl(" ddlPARAMDI RECTION")) ;
    listDirection.SelectedInde x = listDirection.Items.IndexO f(listDire ction.Item s.FindByTe xt(Convert .ToString( DataBinder .Eval(e.It em.DataIte m,"PM_DESC RIPTION")) ));
     Â
  }
}
//************************ ********** ********** ********** *********
//************************ ********** ********** ********** ********** ********
protected void DataGridUserManagementID_I temCommand (object sender, System.Web.UI.WebControls. DataGridCo mmandEvent Args e)
{
  if (e.CommandName == "Insert")
  {
   // TextBox txtType;
   TextBox txtCommandID, txtParameterIndex, txtName, txtDescription, txtContent, txtLength;
   string strTypeID, strDirectionID;
   txtCommandID = (TextBox)e.Item.FindContro l("insertC ommandID") ;
   txtParameterIndex = (TextBox)e.Item.FindContro l("insertP arameterIn dex");
   txtName = (TextBox)e.Item.FindContro l("insertN ame");
   txtDescription = (TextBox)e.Item.FindContro l("insertD escription ");
   txtContent = (TextBox)e.Item.FindContro l("insertC ontent");
   txtLength = (TextBox)e.Item.FindContro l("insertL ength");
  Â
  Â
   strTypeID = ((DropDownList)(e.Item.Fin dControl(" insertType s"))).Sele ctedItem.V alue;
   strDirectionID = ((DropDownList)(e.Item.Fin dControl(" insertDire ction"))). SelectedIt em.Value;
      Â
      Â
       // Create the appropriate SQL statement
       StringBuilder strSQL = new StringBuilder("insert into TBPARAMETERS");
       strSQL.Append("(CM_REF, PM_NAME, PM_TYPE, PM_DIRECTION, PM_LENGTH, PM_CONTENT, PM_INDEX, PM_DESCRIPTION)");
       strSQL.Append(" values (");
       strSQL.Append("'").Append( txtCommand ID.Text).A ppend("' ,");
       strSQL.Append("'").Append( txtName.Te xt).Append ("' ,");
       strSQL.Append("'").Append( strTypeID) .Append("' ,");
       strSQL.Append("'").Append( strDirecti onID).Appe nd("' ,");
       strSQL.Append("'").Append( txtLength. Text).Appe nd("' ,");
       strSQL.Append("'").Append( txtContent .Text).App end("' ,");
       strSQL.Append("'").Append( txtParamet erIndex.Te xt).Append ("' ,");
       strSQL.Append("'").Append( txtDescrip tion.Text) .Append("' )");
   // call the update and rebind the datagrid
   if ((txtCommandID.Text != "") && (txtName.Text != "") && (txtLength.Text != "") &&
      (txtContent.Text != "") && (txtParameterIndex.Text != "") && (txtDescription.Text != ""))
                  ExecuteQuery(strSQL.ToStri ng());
Â
       }
    DataGridUserManagementID.E ditItemInd ex = -1;
    BindData();
 Â
}
//************************ ********** ********** ********** ********** ********
//************************ ********** ********** ********** **********
private void DataGridUserManagementID_C ancel(obje ct source,
System.Web.UI.WebControls. DataGridCo mmandEvent Args e)
{
  DataGridUserManagementID.E ditItemInd ex = -1;
  BindData();
}
//************************ ********** ********** ********** **********
public int GetSelectedIndexDATATYPE (string DT_REF)
{ Â
           int iLoop;
           DataTable dt = ddlDataSet1.Tables["ddlDAT ATYPE"];
           for (iLoop=0; iLoop < dt.Rows.Count; iLoop++)
           { Â
                 string srow = dt.Rows[iLoop]["DT_REF"].T oString();
                Â
                 if(srow == DT_REF)
                 {
                      return iLoop;
                 } Â
           }; Â
           return 0; Â
Â
}
public int GetSelectedIndexPARAMDIREC TION (string PD_REF)
{ Â
           int iLoop;
           DataTable dt = ddlDataSet2.Tables["ddlPAR AMDIRECTIO N"];
           for (iLoop=0; iLoop < dt.Rows.Count; iLoop++)
           { Â
                 string srow = dt.Rows[iLoop]["PD_REF"].T oString();
                     Â
                 if(srow == PD_REF)
                 {
                      return iLoop;
                 } Â
           }; Â
           return 0; Â
Â
}
     Â
           </script>
</HEAD>
<body bgColor="#fef9e9" leftMargin="0" background="images/bg.gif" topMargin="0" marginheigh="0"
           marginwidth="0">
<mspos:header id="header" runat="server"></mspos:hea der>
<center>
<form id="form1" runat="server">
<TABLE height="380" cellSpacing="0" cellPadding="0" width="100%" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD>
<!-- Include start of header -------------------------- ---------- -------->< /TD>
<TD></TD>
</TR>
<TR vAlign="top">
<TD></TD>
<TD><asp:datagrid id="DataGridUserManagement ID" runat="server" OnDeleteCommand="DataGridU serManagem entID_Dele te"
                                            OnUpdateCommand="DataGridU serManagem entID_Upda te" OnCancelCommand="DataGridU serManagem entID_Canc el"
                                            OnItemDataBound="DataGridU serManagem entID_Item DataBound" OnEditCommand="DataGridUse rManagemen tID_Edit"
                                            OnItemCreated="DataGridUse rManagemen tID_ItemCr eated" OnItemCommand="DataGridUse rManagemen tID_ItemCo mmand"
                                            AllowPaging="True" AllowCustomPaging="True" ShowFooter="True" AutoGenerateColumns="False "
                                            GridLines="None" BorderStyle="Outset" font-size="12px" font-names="arial"
                                            width="449px" PagerStyle-HorizontalAlign ="Right" BorderColor="#CCCC99"
                                            BorderWidth="3px" DataKeyField="CM_REF" OnPageIndexChanged="dg_Pag e">
<FooterStyle Wrap="False" ForeColor="#330099" BackColor="#FFFFCC"></Foot erStyle>
<SelectedItemStyle Font-Bold="True" Wrap="False" HorizontalAlign="Center" ForeColor="#663399" VerticalAlign="Middle"
                                                  BackColor="#FFCC66"></Sele ctedItemSt yle>
<EditItemStyle Wrap="False"></EditItemSty le>
<AlternatingItemStyle Wrap="False" BackColor="PaleGoldenrod"> </Alternat ingItemSty le>
<ItemStyle Wrap="False" BackColor="Beige"></ItemSt yle>
<HeaderStyle Font-Bold="True" Wrap="False" ForeColor="White" BackColor="#954896"></Head erStyle>
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="<img src=images/Ok.gif border=0 align=absmiddle alt='Save changes'>"
                                                       CancelText="<img src=images/Cancel.gif border=0 align=absmiddle alt='Cancel editing'>"
                                                       EditText="<img src=images/icn_edit.gif border=0 align=absmiddle alt='Edit this item'>">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle >
</asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="Command ID">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"CM_ REF")) %>' Runat="server" ID="lblCommandID">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertCommandID" Width="80" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editCommandID" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"CM_ REF")) %>' Width="80">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Parameter Index">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ INDEX")) %>' Runat="server" ID="lblParameterIndex">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertParameterIndex" Width="100" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editParameterIndex" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ INDEX")) %>' Width="100">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Name">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ NAME")) %>' Runat="server" ID="lblName">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertName" Width="110" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editName" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ NAME")) %>' Width="110">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Description">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ DESCRIPTIO N")) %>' Runat="server" ID="lblDescription">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertDescription" Width="140" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editDescription" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ DESCRIPTIO N")) %>' Width="140">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Type">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label id="lblType" Runat="server" Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"TYP ENAME")) %>' >
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:DropdownList id="insertTypes" runat="server" DataSource='<%# BindTBDATATYPE() %>' DataValueField="DT_REF" DataTextField="DT_DESCRIPT ION">
</asp:DropdownList>
</FooterTemplate>
<EditItemTemplate>
<asp:DropdownList id="ddlDATATYPE" runat="server" DataSource='<%# BindTBDATATYPE() %>' selectedindex='<%# GetSelectedIndexDATATYPE(D ataBinder. Eval(Conta iner.DataI tem, "TYPENAME").ToString())%>' DataValueField="DT_REF" DataTextField="DT_DESCRIPT ION">
</asp:DropdownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Content">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ CONTENT")) %>' Runat="server" ID="lblContent">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertContent" Width="60" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editContent" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ CONTENT")) %>' Width="60">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Direction">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label id="lblDirection" Runat="server" Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"DIR ECTIONNAME ")) %>' >
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:DropdownList id="insertDirection" runat="server" DataSource='<%# BindTBPARAMDIRECTION() %>' DataValueField="PD_REF" DataTextField="PD_DESCRIPT ION">
</asp:DropdownList>
</FooterTemplate>
<EditItemTemplate>
<asp:DropdownList id="ddlPARAMDIRECTION" runat="server" DataSource='<%# BindTBPARAMDIRECTION() %>' selectedindex='<%# GetSelectedIndexPARAMDIREC TION(DataB inder.Eval (Container .DataItem, "DIRECTIONNAME").ToString( ))%>' DataValueField="PD_REF" DataTextField="PD_DESCRIPT ION">
</asp:DropdownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Length">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ LENGTH")) %>' Runat="server" ID="lblLength">
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:TextBox id="insertLength" Width="50" runat="server"></asp:TextB ox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editLength" Text = '<%# Convert.ToString(DataBinde r.Eval(Con tainer.Dat aItem,"PM_ LENGTH")) %>' Width="50">
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<HeaderStyle Wrap="False"></HeaderStyle >
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:ImageButton CommandName="Delete" id="btnDel" runat="server" Runat="server" alt='Delete this item?'
                                                                  ImageUrl="images/icn_del.g if"></asp: ImageButto n>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle >
<FooterTemplate>
<asp:ImageButton CommandName="Insert" id="btnAdd" runat="server" alt='Add new item' ImageUrl="images/icn_add.g if"></asp: ImageButto n>
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle NextPageText="Next&gt; " PrevPageText="&lt; Prev" HorizontalAlign="Center"
                                                  ForeColor="#330099" BackColor="#FFFFCC" Wrap="False" Mode="NumericPages"></Page rStyle>
</asp:datagrid>
<P align="center"><uc1:logout id="Logout1" runat="server"></uc1:logou t><BR>
<BR>
<mspos:footer id="footer" runat="server"></mspos:foo ter></P>
</TD>
<TD height="272"></TD>
</TR>
</TABLE>
</form>
</center> <!-- Include start of footer -------------------------- ---------- ---------- --> <!------------------------ ---------- ---------- ---------- ---------- ---------- ->
</body>
</HTML>
tbparameters
  CM_REF PM_NAME       PM_TYPE PM_DIRECTION  PM_LENGTH PM_CONTENT                      PM_INDEX PM_DESCRIPTION
---------- --------------- ---------- ------------ ---------- --------------------------
     1 pm_ServNb         8       1      8                               1 Input service number
     2 pm_AccNB         8       1     12                               1 Input account number
     3 pm_LastName        8       1     50                               1 Input last name
     5 pm_Username        8       1     32                               1 Username field
     4 pm_FirstName       8       1     50                               1 Input first name
     5 pm_Password        8       1     40                               2 Password field
     6 pm_PaymNb         8       1     10                               1 Payment number field
     6 pm_CashNb         8       1      8                               2 Cashier number field
     6 pm_Date          8       1     19                               3 Receipt date field
     6 pm_Data          8       1    2500                               4 Receipt data
     7 pm_PaymNb         8       1     10                               1 Payment number field for tbreceipts
I am missing something. It basically does not tell me there is no page 2. I cannot figure the problem out.
<%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logou
<%@ import namespace="System.Web.UI" %>
<%@ import namespace="System.Web.Sess
<%@ import namespace="System.Web" %>
<%@ import namespace="System.Drawing"
<%@ import namespace="System.Componen
<%@ import namespace="System.Collecti
<%@ import namespace="System.Text" %>
<%@ import namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odb
<%@ Register TagPrefix="mspos" TagName="header" Src="Engine/Controls/heade
<%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/foo
<HTML>
<HEAD>
<title>Users Interface to Managing Adminitrators</title>
<meta content="True" name="vs_snapToGrid">
<script language="C#" runat="server">
private DataSet ddlDataSet = new DataSet();
private OdbcConnection myConnection = Â new OdbcConnection("DSN=MSPOS;
private DataSet ddlDataSet1 = new DataSet();
private DataSet ddlDataSet2 = new DataSet();
private string CommandID; Â Â Â Â Â Â Â Â Â Â Â
//************************
// Get TBDATATYPE and populate dataset with DT_REF and DT_DESCRIPTION Â
public DataSet BindTBDATATYPE()
{
           OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;
           // Populate the ddlDataSet1
           myConnection.Open();
           const string strSQLDDL = @"SELECT DT_REF, DT_DESCRIPTION FROM TBDATATYPE ORDER BY DT_REF";
           OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL,
           ddlDataSet1.Clear(); Â
           myDataAdapter.Fill(ddlData
           myDataAdapter.Dispose();
           myDataAdapter = null;
           myConnection.Close();
           return ddlDataSet1;
}
//************************
//************************
// Get TBPARAMDIRECTION and populate dataset with PD_REF and PD_DESCRIPTION
public DataSet BindTBPARAMDIRECTION()
{
           OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;
           // Populate the ddlDataSet2
           myConnection.Open();
           const string strSQLDDL = @"SELECT PD_REF, PD_DESCRIPTION FROM TBPARAMDIRECTION ORDER BY PD_REF";
           OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL,
           ddlDataSet2.Clear(); Â
           myDataAdapter.Fill(ddlData
           myDataAdapter.Dispose();
           myDataAdapter = null;
           myConnection.Close();
           return ddlDataSet2;
}
//************************
Â
//************************
protected void Page_Load(object sender, System.EventArgs e)
{
      if (!Page.IsPostBack)
      {
           BindData();
      }
}
//************************
//************************
private void BindData()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;
  myConnection.Open();
      Â
  // get records from the table
  string commandString = @"SELECT GET_DT_TBDATATYPE(PM_TYPE)
      // Set the datagrid's datasource to the datareader and databind
  // Create a OdbcCommand object and assign the connection connect to the database
  OdbcCommand command = myConnection.CreateCommand
  command.CommandText = commandString;
  command.Connection = myConnection;
      // Create the Reader and bind it to the datagrid
  OdbcDataReader reader =  command.ExecuteReader(Comm
  DataGridUserManagementID.D
  DataGridUserManagementID.D
      reader.Close();
      reader=null;
  myConnection.Dispose();
      myConnection.Close();
       Â
}
//************************
//************************
private void DataGridUserManagementID_S
{
      int intCount;
      for (intCount = 1; intCount <= DataGridUserManagementID.I
        DataGridUserManagementID.I
      DataGridUserManagementID.S
}
//************************
//************************
private void DataGridUserManagementID_D
System.Web.UI.WebControls.
{
 Â
 // Get the CommandID of the row whose Delete button was clicked
  string strCommandID = ((Label)e.Item.FindControl
  int SelectedCommandID = Convert.ToInt32(strCommand
  string strSQL = "Delete from TBPARAMETERS where CM_REF ='"+ SelectedCommandID +"'";
  ExecuteQuery(strSQL);
  Â
  DataGridUserManagementID.E
  BindData();
}
//************************
//************************
private int ExecuteQuery(string sqlCmd)
{
  // Create a OdbcCommand object and assign the connection connect to the database
  OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;
  myConnection.Open();
  OdbcCommand command = myConnection.CreateCommand
  command.CommandText = sqlCmd;
  command.Connection = myConnection;
  return command.ExecuteNonQuery();
}
//************************
//************************
private void DataGridUserManagementID_U
System.Web.UI.WebControls.
{
  // Determine what store was selected
  string strTypeID, strType, strDirectionID, strDirection;
  string cmd;
      string CommandID, strCommandID, strDescription, strName, strTimeout, strContent, strLength;  Â
  ///... declarations for remaining data fields
  CommandID = Session["CommandID"].ToStr
      strCommandID = ((TextBox)e.Item.FindContr
  strDescription = ((TextBox)e.Item.FindContr
  strName = ((TextBox)e.Item.FindContr
      strContent = ((TextBox)e.Item.FindContr
      strLength = ((TextBox)e.Item.FindContr
  strTypeID = ((DropDownList)(e.Item.Fin
       strType = ((DropDownList)(e.Item.Fin
  strDirectionID = ((DropDownList)(e.Item.Fin
  strDirection = ((DropDownList)(e.Item.Fin
     Â
 Â
      // form the update statement
  // connect to the database
  if (e.CommandName == "Update")  Â
      {
           string strsql;
          Â
           if (CommandID != strCommandID)
                 cmd = "Update TBPARAMETERS Set CM_REF='"+ strCommandID +"', PM_NAME ='"+ strName +"', PM_TYPE ='"+ strTypeID +"', PM_DIRECTION = '"+ strDirectionID +"', PM_LENGTH='"+ strLength +"', PM_CONTENT='"+ strTypeID +"', PM_INDEX='"+ strDirectionID +"', PM_DESCRIPTION='"+ strDescription +"' Where CM_REF = "+ CommandID +"";
             else
                  cmd = "Update TBPARAMETERS Set CM_REF='"+ CommandID +"', PM_NAME ='"+ strName +"', PM_TYPE ='"+ strTypeID +"', PM_DIRECTION = '"+ strDirectionID +"', PM_LENGTH='"+ strLength +"', PM_CONTENT='"+ strTypeID +"', PM_INDEX='"+ strDirectionID +"', PM_DESCRIPTION='"+ strDescription +"' Where CM_REF = "+ strCommandID +"";
        Â
         ExecuteQuery(cmd);
            strsql = null;
            Session["CommandID"] = null;
      }
       DataGridUserManagementID.E
  BindData(  );
 Â
}
//************************
//************************
private void DataGridUserManagementID_E
System.Web.UI.WebControls.
{
      CommandID = ((Label)e.Item.FindControl
  Session["CommandID"] = CommandID;
      DataGridUserManagementID.E
  BindData();
}
//************************
//************************
private void dg_Page(object source, DataGridPageChangedEventAr
{
      DataGridUserManagementID.C
  BindData();
}
//************************
//************************
protected void DataGridUserManagementID_I
{
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingIt
      {
           ImageButton btn = (ImageButton)e.Item.FindCo
        btn.Attributes.Add("onclic
      }
}
//************************
//************************
private void DataGridUserManagementID_I
System.Web.UI.WebControls.
{
  ListItemType oType = ((ListItemType)e.Item.Item
  if(oType == ListItemType.Item || oType == ListItemType.AlternatingIt
  {
           e.Item.Attributes.Add("onm
           e.Item.Attributes.Add("onm
      }
     Â
      if ((oType == ListItemType.EditItem))
  {
      Â
    DropDownList listType =((DropDownList)e.Item.Fin
        listType.SelectedIndex = listType.Items.IndexOf(lis
            Â
        DropDownList listDirection =((DropDownList)e.Item.Fin
    listDirection.SelectedInde
     Â
  }
}
//************************
//************************
protected void DataGridUserManagementID_I
{
  if (e.CommandName == "Insert")
  {
   // TextBox txtType;
   TextBox txtCommandID, txtParameterIndex, txtName, txtDescription, txtContent, txtLength;
   string strTypeID, strDirectionID;
   txtCommandID = (TextBox)e.Item.FindContro
   txtParameterIndex = (TextBox)e.Item.FindContro
   txtName = (TextBox)e.Item.FindContro
   txtDescription = (TextBox)e.Item.FindContro
   txtContent = (TextBox)e.Item.FindContro
   txtLength = (TextBox)e.Item.FindContro
  Â
  Â
   strTypeID = ((DropDownList)(e.Item.Fin
   strDirectionID = ((DropDownList)(e.Item.Fin
      Â
      Â
       // Create the appropriate SQL statement
       StringBuilder strSQL = new StringBuilder("insert into TBPARAMETERS");
       strSQL.Append("(CM_REF, PM_NAME, PM_TYPE, PM_DIRECTION, PM_LENGTH, PM_CONTENT, PM_INDEX, PM_DESCRIPTION)");
       strSQL.Append(" values (");
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
       strSQL.Append("'").Append(
   // call the update and rebind the datagrid
   if ((txtCommandID.Text != "") && (txtName.Text != "") && (txtLength.Text != "") &&
      (txtContent.Text != "") && (txtParameterIndex.Text != "") && (txtDescription.Text != ""))
                  ExecuteQuery(strSQL.ToStri
Â
       }
    DataGridUserManagementID.E
    BindData();
 Â
}
//************************
//************************
private void DataGridUserManagementID_C
System.Web.UI.WebControls.
{
  DataGridUserManagementID.E
  BindData();
}
//************************
public int GetSelectedIndexDATATYPE (string DT_REF)
{ Â
           int iLoop;
           DataTable dt = ddlDataSet1.Tables["ddlDAT
           for (iLoop=0; iLoop < dt.Rows.Count; iLoop++)
           { Â
                 string srow = dt.Rows[iLoop]["DT_REF"].T
                Â
                 if(srow == DT_REF)
                 {
                      return iLoop;
                 } Â
           }; Â
           return 0; Â
Â
}
public int GetSelectedIndexPARAMDIREC
{ Â
           int iLoop;
           DataTable dt = ddlDataSet2.Tables["ddlPAR
           for (iLoop=0; iLoop < dt.Rows.Count; iLoop++)
           { Â
                 string srow = dt.Rows[iLoop]["PD_REF"].T
                     Â
                 if(srow == PD_REF)
                 {
                      return iLoop;
                 } Â
           }; Â
           return 0; Â
Â
}
     Â
           </script>
</HEAD>
<body bgColor="#fef9e9" leftMargin="0" background="images/bg.gif"
           marginwidth="0">
<mspos:header id="header" runat="server"></mspos:hea
<center>
<form id="form1" runat="server">
<TABLE height="380" cellSpacing="0" cellPadding="0" width="100%" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD>
<!-- Include start of header --------------------------
<TD></TD>
</TR>
<TR vAlign="top">
<TD></TD>
<TD><asp:datagrid id="DataGridUserManagement
                                            OnUpdateCommand="DataGridU
                                            OnItemDataBound="DataGridU
                                            OnItemCreated="DataGridUse
                                            AllowPaging="True" AllowCustomPaging="True" ShowFooter="True" AutoGenerateColumns="False
                                            GridLines="None" BorderStyle="Outset" font-size="12px" font-names="arial"
                                            width="449px" PagerStyle-HorizontalAlign
                                            BorderWidth="3px" DataKeyField="CM_REF" OnPageIndexChanged="dg_Pag
<FooterStyle Wrap="False" ForeColor="#330099" BackColor="#FFFFCC"></Foot
<SelectedItemStyle Font-Bold="True" Wrap="False" HorizontalAlign="Center" ForeColor="#663399" VerticalAlign="Middle"
                                                  BackColor="#FFCC66"></Sele
<EditItemStyle Wrap="False"></EditItemSty
<AlternatingItemStyle Wrap="False" BackColor="PaleGoldenrod">
<ItemStyle Wrap="False" BackColor="Beige"></ItemSt
<HeaderStyle Font-Bold="True" Wrap="False" ForeColor="White" BackColor="#954896"></Head
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="<img src=images/Ok.gif border=0 align=absmiddle alt='Save changes'>"
                                                       CancelText="<img src=images/Cancel.gif border=0 align=absmiddle alt='Cancel editing'>"
                                                       EditText="<img src=images/icn_edit.gif border=0 align=absmiddle alt='Edit this item'>">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle
</asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="Command ID">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertCommandID" Width="80" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editCommandID" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Parameter Index">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertParameterIndex" Width="100" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editParameterIndex" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Name">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertName" Width="110" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editName" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Description">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertDescription" Width="140" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editDescription" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Type">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label id="lblType" Runat="server" Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:DropdownList id="insertTypes" runat="server" DataSource='<%# BindTBDATATYPE() %>' DataValueField="DT_REF" DataTextField="DT_DESCRIPT
</asp:DropdownList>
</FooterTemplate>
<EditItemTemplate>
<asp:DropdownList id="ddlDATATYPE" runat="server" DataSource='<%# BindTBDATATYPE() %>' selectedindex='<%# GetSelectedIndexDATATYPE(D
</asp:DropdownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Content">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertContent" Width="60" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editContent" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Direction">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label id="lblDirection" Runat="server" Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:DropdownList id="insertDirection" runat="server" DataSource='<%# BindTBPARAMDIRECTION() %>' DataValueField="PD_REF" DataTextField="PD_DESCRIPT
</asp:DropdownList>
</FooterTemplate>
<EditItemTemplate>
<asp:DropdownList id="ddlPARAMDIRECTION" runat="server" DataSource='<%# BindTBPARAMDIRECTION() %>' selectedindex='<%# GetSelectedIndexPARAMDIREC
</asp:DropdownList>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Length">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinde
</asp:Label>
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:TextBox id="insertLength" Width="50" runat="server"></asp:TextB
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="editLength" Text = '<%# Convert.ToString(DataBinde
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<HeaderStyle Wrap="False"></HeaderStyle
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:ImageButton CommandName="Delete" id="btnDel" runat="server" Runat="server" alt='Delete this item?'
                                                                  ImageUrl="images/icn_del.g
</ItemTemplate>
<FooterStyle Wrap="False"></FooterStyle
<FooterTemplate>
<asp:ImageButton CommandName="Insert" id="btnAdd" runat="server" alt='Add new item' ImageUrl="images/icn_add.g
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle NextPageText="Next&gt;
                                                  ForeColor="#330099" BackColor="#FFFFCC" Wrap="False" Mode="NumericPages"></Page
</asp:datagrid>
<P align="center"><uc1:logout
<BR>
<mspos:footer id="footer" runat="server"></mspos:foo
</TD>
<TD height="272"></TD>
</TR>
</TABLE>
</form>
</center> <!-- Include start of footer --------------------------
</body>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.