S
Shakeel
Hello Everyone,
In web DataGrid's ItemTemplate, I've placed a asp:Hyperlink control with id
"hypfeature" within column index 3 and this column also contains some other
asp:Hyperlink controls . DataGrid is being Bounded to the DataTable which
returning some rows. I've to
write code for making asp:Hyperlink "hypfeature" visible or invisible on
the base
of "small" column of the DataTable. I've tried to write some code after
Binding
DataGid control to the DataTable object in page's load event like:
CType(Me.DataGrid.FindControl("hypfeature"), HyperLink).Visible = False
but it throws NullReferenceException.
and I also tried like this:
CType(DataGrid.Items(0).Cells(3).Controls(2), HyperLink).Visible = False
but this raise ArgumentOutOfRangeException, The "hypfeature" is in 4the
cell's 3'rd control. Even DataGrid.Items.count returning zero which means
that It has no control.
I'm not getting what's problem with this code. If some one know then Please
tell
me the right way to access control which is added in web DataGrid.
Thanks.
Shakeel Ahmad
I also tried in the ItemDataBound Event Handler of the DataGrid control
like:
In web DataGrid's ItemTemplate, I've placed a asp:Hyperlink control with id
"hypfeature" within column index 3 and this column also contains some other
asp:Hyperlink controls . DataGrid is being Bounded to the DataTable which
returning some rows. I've to
write code for making asp:Hyperlink "hypfeature" visible or invisible on
the base
of "small" column of the DataTable. I've tried to write some code after
Binding
DataGid control to the DataTable object in page's load event like:
CType(Me.DataGrid.FindControl("hypfeature"), HyperLink).Visible = False
but it throws NullReferenceException.
and I also tried like this:
CType(DataGrid.Items(0).Cells(3).Controls(2), HyperLink).Visible = False
but this raise ArgumentOutOfRangeException, The "hypfeature" is in 4the
cell's 3'rd control. Even DataGrid.Items.count returning zero which means
that It has no control.
I'm not getting what's problem with this code. If some one know then Please
tell
me the right way to access control which is added in web DataGrid.
Thanks.
Shakeel Ahmad
I also tried in the ItemDataBound Event Handler of the DataGrid control
like: