473,387 Members | 1,892 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,387 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 962

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.