Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
903
Ultrawebgrid with SQLDataSource - cannot get basic update/add/delete to work
posted

I have used the Ultrawebgrid for quite a while, however I cannot get a (any) simple bound data grid to perform any updates/adds/deletes.  It look like it does but no updates are performed on the database.  I have tried lots of things and what I have below is, I believe, following the absolute basic example, but this doesn't work, either.

The database is read/write.  I have several other forms where I do updates via code.  I use SQLDatasources elsewhere.

Nothing seems to postback the grid in any way.  I make changes on the web page but nothing happens. I have, in one of the many other tests I have done, trapped the SQLDataSource events but they never get triggered.

Any clues please.

 


Partial Class TestPage2
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.ultrawebgrid1.databind()
    End Sub
End Class

 

<body>
    <form id="form1" runat="server">
    <div>
    </div>
    <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataKeyField="UnitType"
        DataMember="DefaultView" DataSourceID="SqlDataSource1" Height="200px"
        Width="325px">
        <Bands>
            <igtbl:UltraGridBand DataKeyField="UnitType">
                <AddNewRow View="NotSet" Visible="NotSet">
                </AddNewRow>
                <Columns>
                    <igtbl:UltraGridColumn BaseColumnName="UnitType" IsBound="True" Key="UnitType">
                        <Header Caption="UnitType">
                        </Header>
                    </igtbl:UltraGridColumn>
                </Columns>
            </igtbl:UltraGridBand>
        </Bands>
        <DisplayLayout AllowAddNewDefault="Yes" AllowColSizingDefault="Free"
            AllowColumnMovingDefault="OnServer" AllowDeleteDefault="Yes"
            AllowSortingDefault="OnClient" AllowUpdateDefault="Yes"
            BorderCollapseDefault="Separate" HeaderClickActionDefault="SortMulti"
            Name="UltraWebGrid1" RowHeightDefault="20px" RowSelectorsDefault="No"
            SelectTypeRowDefault="Extended" StationaryMargins="Header"
            StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00"
            ViewType="OutlookGroupBy">
            <FrameStyle BackColor="Window" BorderColor="InactiveCaption"
                BorderStyle="Solid" BorderWidth="1px" Font-Names="Microsoft Sans Serif"
                Font-Size="8.25pt" Height="200px" Width="325px">
            </FrameStyle>
            <Pager MinimumPagesForDisplay="2">
                <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
                    WidthTop="1px" />
                </PagerStyle>
            </Pager>
            <EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
            </EditCellStyleDefault>
            <FooterStyleDefault BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
                    WidthTop="1px" />
            </FooterStyleDefault>
            <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid"
                HorizontalAlign="Left">
                <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
                    WidthTop="1px" />
            </HeaderStyleDefault>
            <RowStyleDefault BackColor="Window" BorderColor="Silver" BorderStyle="Solid"
                BorderWidth="1px" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">
                <Padding Left="3px" />
                <BorderDetails ColorLeft="Window" ColorTop="Window" />
            </RowStyleDefault>
            <GroupByRowStyleDefault BackColor="Control" BorderColor="Window">
            </GroupByRowStyleDefault>
            <GroupByBox>
                <BoxStyle BackColor="ActiveBorder" BorderColor="Window">
                </BoxStyle>
            </GroupByBox>
            <AddNewBox Hidden="False">
                <BoxStyle BackColor="Window" BorderColor="InactiveCaption" BorderStyle="Solid"
                    BorderWidth="1px">
                    <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px"
                        WidthTop="1px" />
                </BoxStyle>
            </AddNewBox>
            <ActivationObject BorderColor="" BorderWidth="">
            </ActivationObject>
            <FilterOptionsDefault>
                <FilterDropDownStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid"
                    BorderWidth="1px" CustomRules="overflow:auto;"
                    Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px" Height="300px"
                    Width="200px">
                    <Padding Left="2px" />
                </FilterDropDownStyle>
                <FilterHighlightRowStyle BackColor="#151C55" ForeColor="White">
                </FilterHighlightRowStyle>
                <FilterOperandDropDownStyle BackColor="White" BorderColor="Silver"
                    BorderStyle="Solid" BorderWidth="1px" CustomRules="overflow:auto;"
                    Font-Names="Verdana,Arial,Helvetica,sans-serif" Font-Size="11px">
                    <Padding Left="2px" />
                </FilterOperandDropDownStyle>
            </FilterOptionsDefault>
        </DisplayLayout>
    </igtbl:UltraWebGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ZMConnectionString %>"
        DeleteCommand="DELETE FROM [UnitTypes] WHERE [UnitType] = @UnitType"
        InsertCommand="INSERT INTO [UnitTypes] ([UnitType]) VALUES (@UnitType)"
        SelectCommand="SELECT * FROM [UnitTypes]">
        <DeleteParameters>
            <asp:Parameter Name="UnitType" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="UnitType" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    </form>
</body>

Parents Reply Children