如何动态更改 Telerik 的 radgrid 特定列?
我们的数据源为:
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();
如何使用 c#.net 中的代码隐藏来更改每列的大小?多谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置列的宽度属性是否有意义?查看这篇文章了解如何使用自动生成和声明性操作列
Does setting the Width property of your columns makes sense? Check out this article about how to operate with auto-generated and declarative columns