Note that there are some explanatory texts on larger screens.

plurals
  1. PODownload Option In Table In Asp.Net
    primarykey
    data
    text
    <p>i try to disable/hide or don't want to show download option in reject document like this </p> <p>this is want i want</p> <pre><code> doc id doc name file uplaoded uploaded date department status download 1 analysis abc.docx 12-12-2013 finance approve 2 report fm fm.docx 14-06-2013 finance reject download 3 report ibf ibf.docx 14-06-2013 finance approve 4 report ma ma.docx 14-06-2013 finance reject </code></pre> <p>now in reject row i don't want to show download option because this is rejected documents here is code which i try</p> <pre><code> protected void Repeater4_ItemDataBound(object sender, RepeaterItemEventArgs e) { //DataRowView theDataRowView = e.Item.DataItem as DataRowView; //theDataRowView.Row["Status"] == "Status"; // Only look in data rows, ignore header and footer rows if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { // Get a data view row object so we can reference the data // in the repeater by the bound field names DataRowView theDataRowView = e.Item.DataItem as DataRowView; //theDataRowView.Row["Status"] == "Status"; // Make sure we got the data row view before we try to use it if (theDataRowView != null) { // Get the value of status from the control that holds the value string theStatus = theDataRowView.Row["Status"].ToString(); // Find the download link control LinkButton theLinkButtonDownload = e.Item.FindControl("LinkButton2") as LinkButton; if (theStatus.ToUpper() == "APPROVE") { if (theLinkButtonDownload != null) { theLinkButtonDownload.Visible = true; } } else { if (theLinkButtonDownload != null) { theLinkButtonDownload.Visible = false; } } } } } </code></pre> <p>this is html</p> <pre><code> &lt;div class="CSSTableGenerator"&gt; &lt;table border="0" width="100%" cellpadding="0" cellspacing="0" id="results"&gt; &lt;asp:Repeater ID="Repeater4" OnItemCommand="Repeater4_ItemCommand" runat="server"&gt; &lt;HeaderTemplate&gt; &lt;tr&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; &lt;/td&gt; &lt;td&gt; Document ID &lt;/td&gt; &lt;td&gt; Document Name &lt;/td&gt; &lt;td&gt; File Uploaded &lt;/td&gt; &lt;td&gt; Uploaded By &lt;/td&gt; &lt;td&gt; Document Type &lt;/td&gt; &lt;td&gt; Department Type &lt;/td&gt; &lt;td&gt; Approve Name &lt;/td&gt; &lt;/tr&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:HiddenField ID="HiddenField1" runat="server" Value='&lt;%#DataBinder.Eval(Container.DataItem, "Status")%&gt;'/&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='&lt;%# Eval("FileUploaded") %&gt;' CommandName="download" Visible='&lt;%# Convert.ToString(Eval("Status")).ToUpper() != "Reject" %&gt;' Text="Download" /&gt; &lt;/td&gt; &lt;%-- &lt;td&gt; &lt;asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='&lt;%# Eval("FileUploaded") %&gt;' CommandName="download" &gt;Download&lt;/asp:LinkButton&gt; &lt;/td&gt;--%&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem,"DocumentID") %&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "DocumentName")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "FileUploaded")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "UploadedBy")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "Document")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "Department")%&gt; &lt;/td&gt; &lt;td&gt; &lt;%#DataBinder.Eval(Container.DataItem, "Status")%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>i try code which i posted and it can not show me any error but it always show me download visible in rejected document and i want to in rejected documents dowload option dont want to show</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload