|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Issue getting value from dynamically creating datagrid boundcolumnI am dynamically creating boundcolumns for a datagrid during the databinding event. Everything is rendered properly, but I am unable to get the value of the boundcolumn. The count for the datagridrow cells is only returning 1, which is the static templatecolumn. Any suggestions / insights on why I can't retrieve the values of the boundcolumns is greatly appreciated. Below is the code building the boundcolumns. Thanks, Erik Private Sub dgrdEquip_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgrdEquip.DataBinding 'During the databinding we will loop through the columns on the datatable 'and build a tempalte column that has one imagebutton in it 'add it to the grid.columns collection then 'create another boundcolumn that would display the value in the column Dim tbl As DataTable = dstEquipInv.Tables("EquipInv") If tbl.Rows.Count <> 0 Then Dim dc As DataColumn For Each dc In tbl.Columns Dim bc As New BoundColumn 'add a column to contain the value of the field bc.DataField = dc.ColumnName bc.HeaderText = dc.ColumnName bc.HeaderStyle.CssClass = "TDHeader" bc.SortExpression = dc.ColumnName bc.ItemStyle.CssClass = "TDItem" CType(sender, DataGrid).Columns.Add(bc) End If Next End If End Sub
objectdataSource case sensitive with parameters??
label overlap during design Don't understand state in WebControls class button problem Menu Wrap Problem FormView and HTMLEncode asp:hyperlinkfield format dinamically-created checkbox doesn't load it's state GridView edit mode problem dynamically set property on a control |
|||||||||||||||||||||||