|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
newbie to datagridsI 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> Hi Xarky,
What do you want to remove? Elton Wang elton_w***@hotmail.com >-----Original Message----- also succeded to>Hi, >I designed my datagrid as shown in the code below. I >load the data into it. how to handle> >Now I have added a push button remove, but I don't know >the event. id="dataGridShowUsers" style="Z-INDEX: 101; LEFT:> >Can someone help me out. >Thanks in Advance > > >/******** for datagrid *********/ ><asp:DataGrid DataKeyField="UserID" AutoGenerateColumns="False" >AllowSorting="True" CellPadding="3" > CellSpacing="2" >40px; POSITION: absolute; TOP: 160px" Width="674px" Height="216px" BorderColor="#CCCCCC"> runat="server" >BorderStyle="None" BorderWidth="1px" ForeColor="#000066" BackColor="White"></FooterStyle>> BackColor="White"> > <FooterStyle > <SelectedItemStyle Font- Bold="True" ForeColor="White">BackColor="#669999"></SelectedItemStyle> ForeColor="#000066"></ItemStyle>> <ItemStyle > <HeaderStyle Font- Bold="True" ForeColor="White">BackColor="#006699"></HeaderStyle> DataField="UserID" HeaderText="ID> <Columns> > <asp:BoundColumn >Number"></asp:BoundColumn> <asp:EditCommandColumn HeaderText="Delete" > <asp:BoundColumn DataField="Name" >HeaderText="Name"></asp:BoundColumn> > <asp:BoundColumn DataField="Surname" >HeaderText="Surname"></asp:BoundColumn> > EditText="Remove" >ButtonType="PushButton"></asp:EditCommandColumn> HorizontalAlign="Left" ForeColor="#000066"> </Columns> > <PagerStyle Show quoteHide quote >BackColor="White" Mode="NumericPages"></PagerStyle> > </asp:DataGrid> >. > 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 ***
Bees knees of grid controls for ASP.NET
Datagrid Not Displaying Changea buttoncommand for one record only Retreive values from invisible cell Problem with Paging and Parameter passing using Hyperlink Column @ DATAGRID OnItemDataBound Problem playing around a DataGrid DataGrid with manual dataSource Quick! Simple method for editing a nested datagrid! DataGridPageChangedEventHandler not firing |
|||||||||||||||||||||||