473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dataview problems

I am using the following code to add confirmation code to delete
buttons in a datagrid

Private Sub masterDataGrid_ItemCreated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
masterDataGrid.ItemCreated
Select Case e.Item.ItemType
Case System.Web.UI.WebControls.ListItemType.Item,
System.Web.UI.WebControls.ListItemType.Alternating Item ',
System.Web.UI.WebControls.ListItemType.EditItem
' Find component name
Dim Component_Name As String
Dim dvComponent As System.Data.DataView = New
System.Data.DataView()
dvComponent.Table =
Me.objmanageComponents_data.Tables("usp_Components _get")
Component_Name =
dvComponent.Item(e.Item.DataSetIndex).Item("cpt_Ti tle").ToString()
dvComponent.Dispose()
' Find delete button
Dim myDeleteButton As System.Web.UI.WebControls.Button
myDeleteButton = e.Item.FindControl("DeleteLink")
Dim cMessage As String
cMessage = "return confirm('Are you sure you want to
delete " & Component_Name & "?');"
myDeleteButton.Attributes.Add("onClick", cMessage)

End Select
End Sub

I also have a second child datagrid that fires when a "Details" button
is clicked. I get 21 records returned when nothing is selected but 0
records returned when you click for details. I am new to datasets so
am a little confused as to why I'm getting 0 records back. Is there
some way to reset the datatable without making a mess or to persist
that data? I tried hiding all other delete buttons but the selected
item but this event fires BEFORE the selectedindex_changed event so it
registers 1 behind whatever is selected. Any help would be greatly
appreciated. Thanks in advance.
Jul 21 '05 #1
0 960

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: - R | last post by:
Hello all. I'm new to .Net so please help me out. I have a application with several "Threads" running to observe various things. From time to time each thread need to add an log entry, which...
2
by: Dennis | last post by:
Hi, I am hoping I can get some help with a small problem I have run into using C#. U have an XML file that I load into a Dataset and then display this in a Datagrid. No problems doing this at all....
0
by: jamie shuker | last post by:
Hi I've had a strange problem come to light this morning. Basically we: 1. Obtain some data from a remote XML source 2. Convert this to a data set 3. Create a dataview from the above...
0
by: DotNetJunkies User | last post by:
I have data in my DataTable that lists multiple values in the Roles column which are space separated like this: " AM AMB MCS DIO CO PM3 CAM " I need to be able to query on this column to get back...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
6
by: enrique | last post by:
Hello, I simpy want to place a record ID into a session variable. I know how to create session variables, I'm just can't figure out the syntax for the record item when I'm working with a...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
8
by: KC | last post by:
For a DataView.Rowfilter can I use more than one expression? I want to filter out two different things. For example can I take: dv.RowFilter = "MTX <> 'Customer Forcast'" and ...
2
by: gl | last post by:
What is the quickest way to get an array of datarows (from a typed dataset) into a dataview (for the purpose of sorting to bind to a datagrid)? Like i have a function that returns...
5
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.