|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
accessing a specific cotrol from web DataGrid control.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: Shakeel,
Try doing it in the ItemDataBound and if u have tried it.Try posting your ItemDataBound event method if it isn't working. Patrick *** Sent via Developersdex http://www.developersdex.com ***
I guess this can't be done can it ?
Unhappy call to a 2nd dataItem in ItemTemplate of an asp:TemplateC OWC11 (connect Spreadsheet + Chart) Complex CompareValidator Validations Textbox question (v2.0) Button to link with DataGrid Page is not submitted using Client side validation of.NET validato ie webcontrol tabstrip Tooltip for listbox and combobox problems with activex controls on web page |
|||||||||||||||||||||||