G
Google Jenny
Hi, there. Can a kind soul translate this VB fragment into C# for me?
<asp:TemplateColumn><ItemTemplate><asp:CheckBox id=CheckBox1
runat="server" text='<%# DataBinder.Eval(Container, "DataItem.FileName")
%>' checked='<%# DataBinder.Eval(Container, "DataItem.Checked")
%>'></asp:CheckBox><DIV align="right">(pages:<asp:label id=Label1
runat="server" text='<%# DataBinder.Eval(Container, "DataItem.Pages")
%>'></asp:Label>)</DIV></ItemTemplate></asp:TemplateColumn>
When your cells need contols with Event Handlers assigned dynamically,
you can use the Item_DataBound Event in your code module as: (where the
<i>second</i> control in the first cell is a dropdown box)
BEGIN CODE FRAGMENT
*******************************************************
Private Sub myDG_ItemDatabound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles dgProcedures.ItemDataBound
dim myDropDown as dropdownbox =
directcast(e.item.cells(0).controls(1),dropdownbox)
addHandler myDropDown.SelectedIndexChange, addressof
myDropDownHandler
'rem: the myDropDownHandler should not have a "handles"
statement, but must have the same signature as the
' event hanldler
End Sub
********************************************************
Thanks so much,
Google Jenny
<asp:TemplateColumn><ItemTemplate><asp:CheckBox id=CheckBox1
runat="server" text='<%# DataBinder.Eval(Container, "DataItem.FileName")
%>' checked='<%# DataBinder.Eval(Container, "DataItem.Checked")
%>'></asp:CheckBox><DIV align="right">(pages:<asp:label id=Label1
runat="server" text='<%# DataBinder.Eval(Container, "DataItem.Pages")
%>'></asp:Label>)</DIV></ItemTemplate></asp:TemplateColumn>
When your cells need contols with Event Handlers assigned dynamically,
you can use the Item_DataBound Event in your code module as: (where the
<i>second</i> control in the first cell is a dropdown box)
BEGIN CODE FRAGMENT
*******************************************************
Private Sub myDG_ItemDatabound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles dgProcedures.ItemDataBound
dim myDropDown as dropdownbox =
directcast(e.item.cells(0).controls(1),dropdownbox)
addHandler myDropDown.SelectedIndexChange, addressof
myDropDownHandler
'rem: the myDropDownHandler should not have a "handles"
statement, but must have the same signature as the
' event hanldler
End Sub
********************************************************
Thanks so much,
Google Jenny