Home All Groups Group Topic Archive Search About
Author
31 Mar 2005 8:40 AM
Xarky
Hi,
I designed my datagrid as shown in the code below.  I also succeded to
load the data into it.

Now I have added a push button remove, but I don't know how to handle
the event.

Can someone help me out.
Thanks in Advance


/********    for datagrid    *********/
<asp:DataGrid DataKeyField="UserID" AutoGenerateColumns="False"
AllowSorting="True" CellPadding="3"
                CellSpacing="2" id="dataGridShowUsers" style="Z-INDEX: 101; LEFT:
40px; POSITION: absolute; TOP: 160px"
                runat="server" Width="674px" Height="216px" BorderColor="#CCCCCC"
BorderStyle="None" BorderWidth="1px"
                BackColor="White">
                <FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
                <SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#669999"></SelectedItemStyle>
                <ItemStyle ForeColor="#000066"></ItemStyle>
                <HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#006699"></HeaderStyle>
                <Columns>
                    <asp:BoundColumn DataField="UserID" HeaderText="ID
Number"></asp:BoundColumn>
                    <asp:BoundColumn DataField="Name"
HeaderText="Name"></asp:BoundColumn>
                    <asp:BoundColumn DataField="Surname"
HeaderText="Surname"></asp:BoundColumn>
                    <asp:EditCommandColumn HeaderText="Delete" EditText="Remove"
ButtonType="PushButton"></asp:EditCommandColumn>
                </Columns>
                <PagerStyle HorizontalAlign="Left" ForeColor="#000066"
BackColor="White" Mode="NumericPages"></PagerStyle>
            </asp:DataGrid>

Author
31 Mar 2005 4:48 PM
Elton Wang
Hi Xarky,

What do you want to remove?

Elton Wang
elton_w***@hotmail.com


>-----Original Message-----
>Hi,
>I designed my datagrid as shown in the code below.  I
also succeded to
>load the data into it.
>
>Now I have added a push button remove, but I don't know
how to handle
>the event.
>
>Can someone help me out.
>Thanks in Advance
>
>
>/********    for datagrid    *********/
><asp:DataGrid DataKeyField="UserID"
AutoGenerateColumns="False"
>AllowSorting="True" CellPadding="3"
>                CellSpacing="2"
id="dataGridShowUsers" style="Z-INDEX: 101; LEFT:
>40px; POSITION: absolute; TOP: 160px"
>                runat="server"
Width="674px" Height="216px" BorderColor="#CCCCCC"
>BorderStyle="None" BorderWidth="1px"
>                BackColor="White">
>                <FooterStyle
ForeColor="#000066" BackColor="White"></FooterStyle>
>                <SelectedItemStyle Font-
Bold="True" ForeColor="White"
>BackColor="#669999"></SelectedItemStyle>
>                <ItemStyle
ForeColor="#000066"></ItemStyle>
>                <HeaderStyle Font-
Bold="True" ForeColor="White"
>BackColor="#006699"></HeaderStyle>
>                <Columns>
>                    <asp:BoundColumn
DataField="UserID" HeaderText="ID
>Number"></asp:BoundColumn>
>                    <asp:BoundColumn
DataField="Name"
>HeaderText="Name"></asp:BoundColumn>
>                    <asp:BoundColumn
DataField="Surname"
>HeaderText="Surname"></asp:BoundColumn>
>               
    <asp:EditCommandColumn HeaderText="Delete"
EditText="Remove"
>ButtonType="PushButton"></asp:EditCommandColumn>
>                </Columns>
>                <PagerStyle
HorizontalAlign="Left" ForeColor="#000066"
Show quoteHide quote
>BackColor="White" Mode="NumericPages"></PagerStyle>
>            </asp:DataGrid>
>.
>
Author
1 Apr 2005 6:16 AM
xarky d_best
Hi,
In the datagrid I am representing a table of my database, ie a row in
datagrid is equivalent to a row in a table.

Now with remove I mean to remove a row from the table, that is by
calling an sql command with a known primary key that is also given in
the datagrid.

What I require, that on the click event of the button, I get the value
of the primary key, and call the sql statement for deletion.

Thanks in Advance





*** Sent via Developersdex http://www.developersdex.com ***