473,382 Members | 1,665 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,382 software developers and data experts.

Gridview/DetailsView/EmptyData

geo039
47
Okay okay this is killing me. I have a gridview with a footerrow to add rooms to the selected value of bldg. When there are no rooms I dropped a detailsview in the emptydatatemplate. I wanted to use the same code I have so the user doesn't have to deal with bldgid but nothing is working. Any ideas how I can accomplish this task, maybe I need to redo everything. Footer row says this and works

Expand|Select|Wrap|Line Numbers
  1. Protected Sub gridLocations_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
  2.  
  3.         If e.CommandName = "Insert" AndAlso Page.IsValid Then
  4.  
  5.             ' Insert new record
  6.             Dim roomnum As String = CType(gridLocations.FooterRow.FindControl("txtAddRoom"), TextBox).Text
  7.             Dim bldgid As Integer
  8.            TextBox).Text
  9.  
  10.  
  11.             AddNewRoom(roomnum, bldgid)
  12.  
  13.         End If
If I do this in the emptydatatemplate it doesn't find dvAddRoom. If I take it out and put it under the gridview it finds it but....it still won't let me just take the selected value it says bldgid can't be null

Expand|Select|Wrap|Line Numbers
  1. Protected Sub dvAddRoom_ItemCommand(ByVal sender As Object, ByVal e As DetailsViewCommandEventArgs)
  2.  
  3.         If e.CommandName = "Insert" AndAlso Page.IsValid Then
  4.  
  5.             ' Insert new record
  6.                         Dim roomnum As String = CType(dvAddRoom.FindControl("NewRoom"), TextBox).Text
  7.  
  8.  
  9.             Dim bldgid As Integer
  10.                       bldgid = gridBldgLoc.SelectedValue
  11.  
  12.             AddNewRoom(roomnum, bldgid)
  13.  
  14.         End If
  15.     End Sub
Sep 4 '07 #1
0 842

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jeffmagill | last post by:
Hi Everybody, I'm really hoping that someone can help me out because I have spent too much time on this project already! Basically, I have a DetailsView that handles all the Edits for a...
2
by: nolan | last post by:
I have an asp.net 2.0 page with a gridview and detailsview on the same page set up in a master-details scenario. The gridview and detailsview have separate SQL data sources. The user enters...
1
by: needin4mation | last post by:
Not sure what I'm doing wrong here. I have a gridview and a detailsview. The detailsview is set to insert by default. When I insert data the detailsview it works. The data goes in the database....
0
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown...
0
by: luvdairish | last post by:
Controls (in order on page) 1.)GridView - each row is a work order w/ a link for details in the last column 2.)DetailsView - when user clicks on link from above GridView, the details are shown...
2
by: mike | last post by:
I have a page with a LoginView which contains a Gridview and a DetailsView, each in its own UpdatePanel The problem that I am experiencing is that when I select a record in the Gridview (using a...
1
by: needhelp1 | last post by:
I have gridview with a detailsview below. When I click on 'New' in brings up the DetailsView for inserting. When I click on 'Edit' in does not brink up the DetailsView. What am I doing wrong? I...
2
by: David Ching | last post by:
I am not getting any response to my previous question on reusing a DetailsView to insert and edit the selected row in a GridView. So I'll ask an even more basic question. Newbie alert! ;) When...
2
by: bogdan | last post by:
Hi, Can a single GridView be 'connected' to DetailsView that renders itself differently based on the currently selected row? I have a GridView with rows that could be displayed in the same way...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.