The name gets displayed in the 1ste colum of the datagrid, where in the 2nd colum there is a buttoncolumn with delete button.
How exactly can i use xpath and navigate to the current node lets say with test id="0" and delete it (including name)?
Its unclear how i can say to this method what row he has to delete exactly.
[Code]...
This does delete the first item, but offcourse crashes on the second. How an i make this into something variable that is bound depending on what button i press in my datagrid?
I have a datagrid buttoncolumn which acts as delete buttons for my xml nodes. The elements are simply displayed in a boundcolumn, so there names get displayed.
Each item generated gets a unique id (each time one is made id+++). My question his how can i remove a item (the entire element node with that certain id) when i click on one of the buttons in the bound column?
I was going to display some data using the datagrid tool but rather than being able to edit one row at a time I need to have all cells on all rows in the edit position and then I can save the entire table. Is this possible using datagrid and if not what how should I use a different control?
I have <span> tags in the cells of my datagrid which determine which background color to use. I also want the user to be able to click any cell and highlight the entire row. This works anywhere there's not a span tag. The span tag is somehow canceling this out. What would you do so that fields inside a span tag act like regular fields where you can click on them and the entire row is highlighted?
The first column displays names from a xml file and the button column just hold delete buttons so i can delete the corresponding item to the left of it (1st column).
How exactly can i retrieve/pass this selected value to a function? In other words when i press the button to the right of the name, it passes the value so i can work with that to remove the corresponding xml node. (using XPath)
XmlDocument XMLDoc = new XmlDocument(); XMLDoc.Load(file); XPathNavigator nav = XMLDoc.CreateNavigator(); var node = nav.SelectSingleNode("/root/name['" + ??? + "']"); node.DeleteSelf(); XMLDoc.Save(file);
i have a project that allows users to send requests to another user. When the user views the requests he can select reply. I want to be able delete the item after the user selects reply
I have an asp.net 2.0 web app and one of the pages uses a grid to add/edit items before exporting the contents to excel. The items in the grid are selected based on a dropdown list--after the item in the list is selected, the grid goes and gets the items, populates a dataset and binds the dataset to the gridview. Some of my users are experiencing an issue where after deleting a random number of rows, a row not deleted will disappear or reappear. Though I have witnessed the behavior, I cannot duplicate it on my machine where the developement occurs (Win XP Pro, IIS 5.1, vwd2005 express). The windows 2003 server uses ASP.Net 3.5
Here is the code related to editing and deleting:
[Code]....
If I had to make a guess as to what was occuring, I would say that it appears at times to retain the deleted item's index after the grid is sent back to the user and tries to delete another row. But like I said, I can't duplicate the problem on my dev machine. if this might be caused by .Net 3.5 trying to run a 2.0 site?
I have a repeater which binds a set of data. Within this repeater is a column with various controls for updating, deleting, etc. These are image buttons which fire an onclick event such as "DeleteRecord". All this does is fire a stored procedure, passing in the ID of the record to delete from the CommandArgument of the object.
This works wonderfully... except for one rather huge problem. Once you delete a record, if you refresh the page, the record where the first deleted record used to be gets deleted. For instance... if I have 4 records
1 Record1 2 Record2 3 Record3 4 Record4
and I delete record 2... The page reloads with (which is fine):
1 Record1 3 Record3 4 Record4
...if I then hit refresh...
1 Record1 4 Record4
I assume this is because the erroneously deleted object (record3) is now in the same hierarchical place as the old object used to be and .net therefore doesn't know the difference, the page refreshes and fires the onlick event, grabbing out the command argument of the new object and deletes based on the ID as obtained from the commandargument of the new object. This is obviously a huge problem, if a client did this it would destroy data erroneously and I'm at a loss here. Is there any way to stop this from happening? I'm not sure if there is a better way to go about doing things or not. If there isn't, I need some sort of way to tell the page not to execute the event or to cross reference the ID of the object that is intended for deletion against the object itself...
Code below for convenience...
EDIT Wrapped a LinkButton around it because I have some jquery code in here as well which stops the page execution to wait for user confirmation. Pressing "ok" continues page execution.
<asp:LinkButton ID="oDeleteLink" CssClass="oDeleteIcon" CommandName="Delete" CommandArgument='<%# Eval("iAccountID") %>' runat="server"> <asp:ImageButton ImageUrl="/files/system/icons/trash-steel-16.png" ToolTip="Delete This Account" AlternateText="Delete" ID="oDeleteIcon" runat="server" /> </asp:LinkButton> protected void oAccounts_ItemCommand(Object Sender, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int ID = e.CommandArgument.ToString().Numeric(); db.SPs.SpDeleteAccount(ID).Execute(); UI.Confirm(uiBroadcast, "Account has been deleted", "300px"); BindAccounts(); } }
I created a sitemap with a treeview navigation in my aspx site. I am hoping someone can show me the code to put in a Masterpage so that when I expand a child node, all other nodes collapse, and when I expand another node, the previous expanded node collapses.
I have an example here of what I am trying to accomplish:
[URL]
I am using asp.net with VB.
I have been scouring the internet looking for a solution, but so far haven't found anything that works.
I'm populating a treeview dynamically. On OnTreeNodePopulate I call a sub and populate the Parent nodes. I do not want to populate the child nodes at this time. Upto this point it works fine.
Now I would like the user to click the parent node and then populate the child node. I tried to use TreeNodeExpanded, but that is called for each parent node, so that didn't work.
I have a second level node that goes onto two lines. The first line indents 15px as is set by the class for node level 2. The seond line kicks back to the same level as 1st level nodes. Here's what I mean:
i want to create one treeview dynamically which will have child node and sub child node.for this i am getting my treeview value from the table with below column:Id,Name,Parent,IsActivewhere main parent nodes parent id will be 0 and then all other records parent id would be related id. the table structure would look
I know how to handle the filtering of the grid (create a criteria and set to rowfilter of the dataview) But, I dont know how to get the value of the column of the selected row.
I have Datagrid , i want to clcik on row and get data in textbox , but my textbox is FreeTextBox control,i tried to use javascript but work for asp.net control not working for freetext box control, how i can capture this code is sample code but it work for asp.net control but not working for my freetextbox
Simply put... I want to duplicate the example found at this link, in VB.net rather than C#.
[URL]
I would like the selectedvalue of the dropdown to display additional data base on its selection in multiple text boxes.
I have tried using the DropDownList OnSelectedIndexChanged property, within a DataGrid EditiItemTemplate, but I cannot retrieve data from the selection. (AutoPostBack is "True"). I can however use a button onclick event to fire a "prre-defined" selection value.
I have 2 datagrid (using .net 1.1). I need to access column of second grid ( i need to make a column of second grid as disabled) when i click "Cancel" link button in First Grid. How can this be done?
I had called the data from query to data table and now i have a gridview in which i am using one datalist and 2 text boxes and and reming coloumns are bounded iahve to assiaign them values which datatable have either null or any value.
I've built a complex site for a client, who wants this duplicated, and re-skinned, so it can be used for other means. What is the best way of doing this? I'm concerned about copying every file as this means any bugs must be fixed twice, and any improvements must be implmented twice.