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

Help with adding extra Row to Datagrid...

I posted this in the datagrid forum but got no bites, so I thought I'd
post it here as well for some help....
I've created a datagrid with 1 edititemtemplate column. When the user
clicks edit, it spans the entire width of the datagrid (removing the
other cells). This column has several controls in it (text boxes,
radiobuttons, and a dropdownlist). Also, on the itemdatabound, I am
adding another row to the datagrid (above the edititemtemplate) to act
as a "header" row, which shows the row being editted in its original
state.

Make sense so far?

Ok, all my data gets bound to my controls correctly, no problem.
However, when I click update, 1 control fails - that's the dropdown.
It still exists, but it is has no datasource, no items, etc...they've
been lost. I was setting my dropdown datasource using the same method
as shown at http://aspnet.4guysfromrolla.com/art...80702-1.2.aspx
and also tried the approach at
http://www.4guysfromrolla.com/webtech/050801-1.shtml. Again, they
both work to create the dropdown, but I lose it on the updatecommand.

Now, if I move my "header" row to be below the item being editted,
everything is happy and still works. However, visually, that doesn't
make sense to the user.

Any way to get it to work with the added header row? I'm using:

For m = 0 To DataGrid1.Columns.Count - 1
mycell = New TableCell
mycolumnname = DataGrid1.Columns(m).HeaderText
If Not mycolumnname.Equals(String.Empty) Then
mycell.Text = dt.Select("ID = " &
viewstate("myrowid"))(0).Item(DataGrid1.Columns(m) .HeaderText)
End If
mycell.ApplyStyle(DataGrid1.SelectedItemStyle)
dgitem.Cells.Add(mycell)
Next
If DataGrid1.SelectedIndex > -1 Then
DataGrid1.Controls(0).Controls.AddAt(DataGrid1.Sel ectedIndex + 2,
dgitem)
End If

to create my header row. It looks nice, but that darned dropdownlist
just isn't working.

Any help would be greatly appreciated!
Jul 21 '05 #1
0 2639

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

Similar topics

3
by: Abhas | last post by:
> > Hi, this is Abhas, > > I had made a video library program in C++, but was facing a problem. > > After entering 12 movies, i cannot enter any more movies. > > Something gibberish comes instead....
28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
6
by: Bart Schelkens | last post by:
Hi, I have another question. On my asp-page I put a label. I manually create a table and set that table in the text of the label. This way my table is displayed. My question is how can i...
3
by: serge calderara | last post by:
Dear all, I have a datagrid which is populated with a dataset as follow: myDataGrid.DataSource = ds.Tables(0) myDataGrid.DataBind() Then I need to create a Hyperlink column from my...
2
by: Terry Olsen | last post by:
Most of the Apps I write are 'Data Mining' apps. In VB6, I used the MSFlexGrid a lot. Now i'm trying to understand the use of the DataGrid, DataTable, & DataSet. Using examples I've gotten...
1
by: Geraldine Hobley | last post by:
Hello, I have a problem whereby I have a datagrid and and extra field all bound to the same dataset. I can easily edit rows in the dataset by changing the bindingposition in the...
12
by: cjobes | last post by:
Hi all, I'm trying to create a dataset as a component to make it accessable from all forms. I have used that following code so far in the component designer: Inherits...
0
by: Brian Greiwe | last post by:
I posted this in the datagrid forum but got no bites, so I thought I'd post it here as well for some help.... I've created a datagrid with 1 edititemtemplate column. When the user clicks...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.