Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 WPF 应用程序,其中有一个具有 5 列的 Telerik RadGrid。我的要求是这些列的列宽应该根据列中显示的字符数来设置。例如,如何设置列宽,只显示 50 个字符?(即如何根据字符数设置列宽?)
将列宽设置为Auto,它会自动将您的宽度调整为内容的大小
Auto
确保您RadGrid.Width没有设置为拉伸,或者您至少有 1 个*宽度列,否则它将拉伸所有内容以适应可用空间,而不是根据内容的大小。
RadGrid.Width
*