Dotzonoktub
New Member
i try to change the gridview size and rename the header after binding the data,but i got the error "Index was out of range" because my data are more than 100px,How to solve it?\[code\] conn.Open(); cmdString = "SQL"; cmd = new SqlCommand(cmdString, conn); cmd.Parameters.AddWithValue("@courseID", CourseID); dtr = cmd.ExecuteReader(); gvAssignment.DataSource = dtr; gvAssignment.Columns[7].ItemStyle.Width = Unit.Pixel(100); gvAssignment.DataBind(); dtr.Close(); conn.Close();\[/code\]