auspicious
New Member
I need to hide a control in a DataGrid. But I need to check if I need to hide it at each row in the Grid.<BR><BR>Here is what I have tried:<BR><BR>In the ItemTemplate, adding a <%# SomeSub %> who check if it can write the <asp:linkbutton... code. It return the code itself. Unfortunatly, this code seem to happen too late. Even though the control is runat="server" it is not prosessed by the server but written plain in the HTML.<BR><BR>I tried to put the If right into the ItemTemplate, but I can't figure out a way of getting the Container.DataItem("WhatINeed")<BR><BR>I tried to put the Code into the Event OnItemCreated or OnItemDataBound, but the control is either not yet created, or innaccessible. The e.Item.ItemIndex is -1 so I cannot do a FindControl based on this.<BR><BR>I am out of answer, do you have anything I can use to test another solution ?I'll check two time more than one next time i cut and paste some code. The solution was the OnItemDataBound event, but the code I found somewhere on the net was not correct.