如题,DATALIST ITEM 固定长宽

解决方案 »

  1.   

    在ItemTemplate中放一个Div,调整Div的大小!如果你要让记录以省略号显示!我的做法是在ItemTemplate中的控件的DataBinding事件中处理!
    例如:
        protected void lbl_Content_DataBinding(object sender, EventArgs e)
        {
            Label ContentLabel = (Label)sender;
            if(ContentLabel.Text.Length > 50)
            {
                ContentLabel.Text = ContentLabel.Text.Substring(0, 50) + "......";
            }
        }限定了显示50个字符,后面用"......"表示!