473,385 Members | 1,409 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,385 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 2637

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: 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...
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: 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...

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.