Forms Data Controls :: Show / Hide Data In GridView?
Mar 12, 2010
I have three columns in my GridView. Columns are FileName,
FileType and More. More field is a link field. If you click on the link, it should display the data (Created Date:10/03/2010
) like this.
Protected Sub SQLDShowActionRef_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SQLDShowActionRef.Selected
I have a webpage that lists information about trucks and their map sections and whether the combination is active and will be used.
On the page I put a check box that says Show Only Active and marked the checked property as true by default. When the RowDataBound event fires I check to see if that checkbox is marked as true and if it is I check if the individual map sections are marked as active. If they are not active then I set the row visibility equal to false like below.
Then I am adding boundfield to gridview for all 4 columns. Now I want to check if "Type" column contain "Sales" thne do not show "Manager" columns. Let me know can I do this?
Now in server side i am trying to hide this column but failed !!
protected void gv_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.DataRow) gv.Columns[2].HeaderStyle.CssClass = "hiddenClass"; // here i am setting display:None using css class }
I have a gridview, which contains a template field with a button. On this button, I want to show and hide another column with this one button. I don't want to use Java Script because my site already uses a lot of this and AJAX. So, can someone show an example of some code behind, which is what I want to do on how to show and hide another column on a gridview?
I am using VS2008.I am binding dynamic datatable to gridview. I have few dropdowns and textboxes in gridview. I have dropdownlist(ddlTrCodeNw_)in gridview foooter template. Based on the selection of Trcode value few controls will be enabled,disabled,visible,hide. in gridview.
<asp:GridView ID="gvAPPost" runat="server" Width="100%" ShowFooter="true" AllowPaging="true" AutoGenerateColumns="false" onrowcommand="gvAPPost_RowCommand" onrowdatabound="gvAPPost_RowDataBound" > <Columns> <asp:TemplateField HeaderText="Discount %" Visible="false"> <FooterTemplate> <asp:TextBox ID="txtDiscountPerNw" runat="server" Width="40px" Enabled="false" Visible="false" ></asp:TextBox > </FooterTemplate> <ItemTemplate> <asp:TextBox ID="txtDiscountPer" runat="server" Width="40px" Enabled="false" Visible="false"></asp:TextBox > </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Intially I set TemplateField HeaderText also Visible="false". so i have written the condition in ddlTrCodeNw_SelectedIndexChanged. Now when if(ddlTrCodeNw.SelectedValue=="24") { txtDepstNw.Enabled = true; txtDepstIncNw.Enabled = true; txtCrdtNw.Enabled = false; txtCrdtIncNw.Enabled = false; lblDiscTrcodeNw.Visible = true; // I want to show this TemplateField HeaderText also when i need. }
I can I show TemplateField HeaderText also whenever i need.
I am looking at building a grouping gridview, which I will know, will suit my needs. Therefore, I am not looking for a nested gridview. My answer is based upon an example I found at [URL]
However, what I am looking to do is to add a button to the group header row, which when pressed the rows within the group can either be shown or hidden.
I am adding two button in gridview here I populate gridview on page load this work fine problem is that when my status value are check or peending then my two button are show.
But I want when my status value are check then check button should be hide
And view button show in which row where staus value are check But when my status value are peending here show check button and view button should be hide. I want follwing type .
I got how to add textbox to gridview at footer... it working fine... but if i do pagination for it.. textbox at footer in gridview reapeting in all page.. but i want to show that textbox at last page of gridview..
i am using template field display image based on condition in table field. i have field name verify i used to store yes or no value if it is yes then display image else noting to display in gridview
I am using a ListView to display a list of Products. My DB has a field named productImage. What I want to do is show this row if there is a picture associated with the product, Hide this row is there is no picture associated with the product.So on the Listview_ItemCreated Event I have this: