大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE稳定放心使用
ComponentOne.Studio.Enterprise.2006中的(C1StudioAspNET2_T106)是著名的C1开发的针对ASP.NET2.0的一套控件库.为ASP.NET开发人员提供了功能丰富的Web开发组件。包括个表格,报表,图表,数据,用户界面和电子商务组件等支持.C1WebGrid是其中最基本的控件之一.
下面介绍它的具体应用方法:
添加引用:
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<%
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
@ Register Assembly=“C1.Web.C1WebGrid.2“ Namespace=“C1.Web.C1WebGrid“ TagPrefix=“C1WebGrid“
%>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
在网页中添加定义
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
c1webgrid:c1webgrid
id
=”C1WGridResult”
width
=”100%”
runat
=”server”
allowpaging
=”True”
allowsorting
=”True”
backcolor
=”White”
bordercolor
=”#999999″
borderstyle
=”Groove”
borderwidth
=”1px”
cellpadding
=”3″
groupindent
=””
pagesize
=”30″
allowcolsizing
=”True”
imagesortascending
=”~/images/up.gif”
imagesortdescending
=”~/images/down.gif”
onpageindexchanging
=”C1WGridResult_PageIndexChanged”
onsortingcommand
=”C1WGridResult_SortingCommand”
onitemdatabound
=”C1WGridResult_ItemDataBound”
onitemcreated
=”C1WGridResult_ItemCreated”
>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
footerstyle
backcolor
=”#CCCCCC”
font-size
=”9pt”
font-bold
=”False”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
forecolor
=”Black”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
selecteditemstyle
backcolor
=”White”
font-bold
=”False”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
forecolor
=”White”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
itemstyle
backcolor
=”WhiteSmoke”
font-size
=”9pt”
font-bold
=”False”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
forecolor
=”Black”
horizontalalign
=”Left”
bordercolor
=”#E0E0E0″
borderstyle
=”Dashed”
borderwidth
=”1px”
wrap
=”False”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
groupingstyle
backcolor
=”White”
bordercolor
=”Silver”
borderwidth
=”1px”
wrap
=”False”
></
groupingstyle
>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
pagerstyle
backcolor
=”#DEDBDE”
font-bold
=”False”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
forecolor
=”Black”
horizontalalign
=”Left”
mode
=”NumericPages”
borderstyle
=”Groove”
borderwidth
=”1px”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
headerstyle
backcolor
=”#999999″
font-size
=”9pt”
height
=”25px”
font-bold
=”True”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
forecolor
=”Black”
cssclass
=”C1WGridCss”
wrap
=”False”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
<
alternatingitemstyle
backcolor
=”LightGray”
font-bold
=”False”
font-italic
=”False”
font-overline
=”False”
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
=”False”
font-underline
=”False”
bordercolor
=”#404040″
borderstyle
=”Dotted”
borderwidth
=”1px”
/>
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
</
c1webgrid:c1webgrid
>
下面介绍几个基本的属性:
allowpaging=”True” ——是否允许分页
allowsorting=”True”——是否允许排序
pagesize=”30″ ——页面包含的记录的条数
allowcolsizing=”True”——是否允许通过拖动改变列宽
imagesortascending=”~/images/arrow_up.gif”,imagesortdescending=”~/images/arrow_down.gif” ——指定排序时在列首显示的图片
onpageindexchanging=”C1WGridResult_PageIndexChanged” ——关联到分页处理函数onsortingcommand=”C1WGridResult_SortingCommand” ——关联到排序函数
onitemdatabound=”C1WGridResult_ItemDataBound” ——关联到数据绑定处理函数
onitemcreated=”C1WGridResult_ItemCreated”——在每个Item创建后触发
onsortingcommand——处理排序示例
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
protected
void
C1WGridResult_SortingCommand(
object
sender, C1.Web.C1WebGrid.C1SortingCommandEventArgs e)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
{
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
//
这里代码的目的是为了使不能排序的列,如模板列,的列
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
//
头显示为文字形式而不是连接形式,因为在这个控件中,
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
//
即使把列的SortExpression设置为空也还是会在列头处
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
//
显示为一个linkbutton(和GridView不同)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
protected
void
C1WGridResult_ItemCreated(
object
sender, C1.Web.C1WebGrid.C1ItemEventArgs e)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
{
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
![使用ComponentOne C1WebGrid控件「建议收藏」](https://javaforall.cn/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
另外还可以通如下设置使相同内容的两个Cell合并
C1WGridResult.Columns[2].RowMerge = C1.Web.C1WebGrid.RowMergeEnum.Free;//合并相同
转载于:https://www.cnblogs.com/hjzhang/archive/2006/09/09/2043597.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/185448.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...