I have a working WebDataGrid with <Columns> and then various <ig:BoundDataField>.
Within these, I have added
How would I restrict this HyperLink from appearing when some of the data in my DataBound data is not available? In other words, I only want the Hyperlink with "Details" as the text to only appear if a certain field is populated within the underlying collection of data. I don't want the hyperlink to appear in every row of data.
Thank you for your patience during my investigation.
In order to selectively show or hide HyperLink for different rows in WebDataGrid, I will suggest two different approaches. Instead of using templated column you can include the HTML for the link in the grid as it will render. You can create the link in initialize row event in an UnboundField. Then not rendering the link is as simple as not setting the content of the cell.Although I will suggest using the above approach, alternatively you can also use the FormatFieldMethod to create the link (you will have to bind to the id column so you will have a unique value to identify the row). Note that you should use the id of the row rather than the index for the link since indexes can change for many reasons like sorting.
If you have further questions, please let me know.
Sincerely,NickEntry-Level Software Developer
Nick, thanks for the response back. Here is what I formulated to use:
If things are Not Set, we use the notation "[N/S]". So, if there's no reason for the link, I make the text of the hyperlink the empty string; otherwise, I provide a link. This works. Thanks again,
Thank you for your feedback.
I am glad to know that you were able to achieve the functionality you were looking for.
If you have any questions, please let me know.