Hello,
i have a WebDataGrid and one of this columns should contain either a HyperLink or a Label depending on the type of item. So, if it is a "Folder" then a HyperLink should be shown and the user should drill-down to the next level in folder hierarchy. In case of a "File" i would only have a Label.
I converted the boundfield into a template view. But at design time i could only add both controls.
Has anyone a sample how to do this?
Thank you
Martin
Hello Stumpy74,
I would suggest that you handle the InitializeRow event and depending on your condition hide or show the Label or HyperLink. You can access template controls using the following syntax:
((Label)e.Row.Items[1].FindControl("Label1")).Visible = false;
Please let me know if you have any further questions.
Dear Nikolay,
that is the solution. It works fine.
Thanks