コード例 #1
0
        public override void InternalRenderCell(HtmlTextWriter writer, Alphora.Dataphor.DAE.Runtime.Data.IRow currentRow, bool isActiveRow, int rowIndex)
        {
            string tempValue;

            if ((ColumnName == String.Empty) || !currentRow.HasValue(ColumnName))
            {
                tempValue = String.Empty;
            }
            else
            {
                tempValue = ((DAE.Runtime.Data.Scalar)currentRow.GetValue(ColumnName)).AsDisplayString;
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, GetClass(currentRow, isActiveRow));

            if (!_wordWrap)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Nowrap, null);
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Align, TextAlignment.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Valign, VerticalAlignment.ToString());
            if (_verticalText)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Style, "mso-rotate:-90");
            }
            if (_maxRows >= 1)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Rows, _maxRows.ToString());
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            if (tempValue == String.Empty)
            {
                writer.Write(" ");
            }
            else
            {
                writer.Write(HttpUtility.HtmlEncode(Session.TruncateTitle(tempValue, Width)).Replace("\n", "<br>"));
            }

            writer.RenderEndTag();
        }
コード例 #2
0
        public override void InternalRenderCell(HtmlTextWriter writer, Alphora.Dataphor.DAE.Runtime.Data.IRow currentRow, bool isActiveRow, int rowIndex)
        {
            bool hasValue  = currentRow.HasValue(ColumnName);
            bool tempValue = false;

            if (hasValue)
            {
                tempValue = ((DAE.Runtime.Data.Scalar)currentRow.GetValue(ColumnName)).AsBoolean;
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, GetClass(currentRow, isActiveRow));
            if (!ReadOnly)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Onclick, String.Format("Submit('{0}?ActionID={1}&RowIndex={2}',event)", (string)Session.Get(this).Context.Session["DefaultPage"], CheckID, rowIndex));
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Valign, "middle");
            writer.AddAttribute(HtmlTextWriterAttribute.Align, "center");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Width, "10");
            writer.AddAttribute(HtmlTextWriterAttribute.Height, "10");
            writer.AddAttribute
            (
                HtmlTextWriterAttribute.Src,
                String.Format
                (
                    "images/{0}{1}.gif",
                    tempValue.ToString().ToLower(),
                    ReadOnly ? "readonly" : ""
                )
            );
            writer.RenderBeginTag(HtmlTextWriterTag.Img);
            writer.RenderEndTag();

            writer.RenderEndTag();              // TD
        }