TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
aartikaur
NA
13
0
Problem with Datagrid
Oct 1 2004 12:48 AM
hi friends, i have got a small problem I want to add a new row to the Datagrid(not bound to nay database table) when i select any value from a dropdownlist(which is in one of the columns of the datagrid) such that the previous rows should maintain their value as before and only a new row is added. i am pasting the code chunk below please tell me what is going wrong because the row gwets added only once and no event is fired second time private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { Table1 = new Table(); TableRow row = new TableRow(); Table1.Rows.Add (row); DataGrid1.DataSource=Table1.Rows; DataGrid1.DataBind(); } } protected void dd1_SelectedIndexChanged(object sender, EventArgs e) { DataGridItem dgi = (DataGridItem)(((Control)sender).NamingContainer); DropDownList ddl = (DropDownList) dgi.Cells[0].Controls[1]; DataGrid dg =(DataGrid) dgi.Parent.Parent; TableCell tc = new TableCell(); Label l1 = new Label(); l1.Text ="hi"; tc.Controls.Add(l1); DataGridItem dgItem = new DataGridItem(dgi.ItemIndex+1,0,ListItemType.Item); dgItem.Cells.Add(tc); DataGrid1.Controls[0].Controls.AddAt(dgi.ItemIndex+1,dgItem); }
Reply
Answers (
0
)
I need to get the values of USERID and put it in a string.
Flash