UltraWebGrid中格式化字符串
2009-03-01 18:01
274 查看
internal void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e) { // Allow for deletion e.Layout.AllowDeleteDefault = AllowDelete.Yes; // allow update for the WebGrid e.Layout.AllowUpdateDefault = AllowUpdate.Yes; UltraGridColumn c; // formats the Date column e.Layout.Bands[0].Columns.FromKey("Date").Format = "MM/dd/yyyy"; // Sets up the format for the Received column c = e.Layout.Bands[0].Columns.FromKey("Received"); c.Format = "$###,###.00"; c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); c.CellStyle.HorizontalAlign = HorizontalAlign.Right; c.DefaultValue = 0; // Sets up the format for the payment column c = e.Layout.Bands[0].Columns.FromKey("Payment"); c.Format = "$###,###.00"; //c.CellStyle.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(128))); c.CellStyle.BackColor = System.Drawing.Color.LightYellow; c.CellStyle.HorizontalAlign = HorizontalAlign.Right; c.DefaultValue = 0; // Adds an unbound column for the description field and moves it into the 2nd column slot e.Layout.Bands[0].Columns.Add("Description", "Description"); c = e.Layout.Bands[0].Columns.FromKey("Description"); c.Move(1); // Adds an unbound column to act as a summary column e.Layout.Bands[0].Columns.Add("Balance","Balance"); c = e.Layout.Bands[0].Columns.FromKey("Balance"); c.Format = "$###,###.00"; c.CellStyle.BackColor = System.Drawing.Color.LightSteelBlue; c.CellStyle.HorizontalAlign = HorizontalAlign.Right; // turn off editing of the last column c.AllowUpdate = AllowUpdate.No; // sets up the backcolor on the lables this.ulCurrentBalance.BackColor = Color.LightSteelBlue; this.ulPayable.BackColor = Color.LightYellow; this.ulReceivable.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224))); }
相关文章推荐
- 轻松实现UltraWebGrid中的分页控制
- 从Infragistics UltraWebGrid 导出数据到Excel再续
- 使用UltraWebGrid排序需注意的几处
- 在UltraWebGrid单元格中绑定WebNumericEdit或其它可编辑控件
- NetAdvantage的UltraWebGrid的全选控件设计
- UltraWebGrid禁止编辑单元格
- Infragistics ultraWebGrid errors
- 求助:UltraWebGrid当用xml paging(ajax)时,如何取其子表的band的index或者子表行信息?(NetAdvantage)
- UltraWebGrid根据单元格文字长度自适应列宽
- UltraWebGrid根据单元格内容禁用checkbox列
- 将字符串转成DataSet绑定到Grid中和读写web.config文件
- 轻松实现UltraWebGrid中的分页控制
- 编写的c#读取Excel表中的內容,并把內容显示到UltraWebGrid上
- UltraWebGrid如何获取点击模板列中控件所在的行号
- 客户端为UltraWebGrid增加新行
- UltraWebGrid用到的合并功能实现
- UltraWebGrid模板列及行的相关操作(转)
- UltraWebGrid双击BUG??
- UltraWebGrid模板列及行的相关操作
- Infragistics控件对UltraWebGrid单元格编辑进行控制及样式设置