views:

633

answers:

1

we have the datasource as :

rgSubjects.DataSource = entity.Student_Subject_MM.Include("Subjects").
        Where(p => p.StudentID == _currentStudent.StudentID
            && (p.Subject.SchoolYear == schoolyear || schoolyear == "0")
            && (p.Subject.Semester.Value == sem || sem == 0)
            && (p.Subject.SubjectCode.Contains(searchSubject) || p.Subject.Description.Contains(searchSubject) || p.Subject.Title.Contains(searchSubject))
        ).Select(p => new {
            SubjectCode = p.Subject.SubjectCode.Trim(),
            Description = p.Subject.Description.Trim(),
            Schedule = p.Subject.Schedule.Trim(),
            Room = p.Subject.Room.Trim(),
            Instructor = p.Subject.Instructor.LastName + ", " + p.Subject.Instructor.FirstName,
            Grade = p.Grade,
            Remarks = p.Remarks
        });
rgSubjects.DataBind();

How can we change the sizes per column using code-behind in c#.net? thanks a lot.

A: 

Does setting the Width property of your columns makes sense? Check out this article about how to operate with auto-generated and declarative columns

Dick Lampard