作成日: 2019/12/09 最終更新日: 2019/12/09
文書種別
使用方法
詳細
C1GridViewのRowCreatedイベントを使用して、C1TemplateFieldのItemTemplateに設定したコントロールを行単位で非表示にすることができます。
◎サンプルコード(aspx)
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(aspx)
<wijmo:C1GridView ID="C1GridView1" runat="server" ・・・>
<Columns>
<wijmo:C1TemplateField>
<ItemTemplate>
<asp:Button ID="Button1" runat="server" ・・・/>
</ItemTemplate>
</wijmo:C1TemplateField>
・・・
</Columns>
</wijmo:C1GridView>
<Columns>
<wijmo:C1TemplateField>
<ItemTemplate>
<asp:Button ID="Button1" runat="server" ・・・/>
</ItemTemplate>
</wijmo:C1TemplateField>
・・・
</Columns>
</wijmo:C1GridView>
◎サンプルコード(VB)
Protected Sub C1GridView1_RowCreated(sender As Object, e As C1.Web.Wijmo.Controls.C1GridView.C1GridViewRowEventArgs) Handles C1GridView1.RowCreated
If e.Row.RowIndex Mod 2 = 1 Then
e.Row.FindControl("Button1").Visible = False
End If
End Sub
If e.Row.RowIndex Mod 2 = 1 Then
e.Row.FindControl("Button1").Visible = False
End If
End Sub
◎サンプルコード(C#)
protected void C1GridView1_RowCreated(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewRowEventArgs e)
{
if (e.Row.RowIndex % 2 == 1)
{
e.Row.FindControl("Button1").Visible = false;
{
}
{
if (e.Row.RowIndex % 2 == 1)
{
e.Row.FindControl("Button1").Visible = false;
{
}
旧文書番号
84712