.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Need to hide gridview - not working

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

 I am trying to hide my Gridview when UpdateProgress control is being shown. Currently both the GridView and UpdateProgress contriols are being shown at same time. It works fine when I select from my DroDownList3 the 1st time (as no GridView is beings shown). On subsequent selections in the DroDownList3 control, both GridView3 and UpDateProgress control are shown.

<script type="text/javascript">
            function HideGridView2()
<cc1:TabContainer ID="TabContainer1" runat="server" Height="20px" ActiveTabIndex="0">
                    <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Current Shift" Style="font-size: xxx-small"
                            Current Shifts
                            <br />
                            <div style="height: 30px; left: 

View Complete Post

More Related Resource Links

hide gridview column using javascript. working in ie and firefox but In firefox, gridview data is sh


function EnableDisableGridViewColumn() {
               var AdvanceSearch = document.getElementById('<%= chkboxlist1.ClientID %>');
               var chkList = AdvanceSearch.getElementsByTagName("input");
               var dgTest = document.getElementById("gridview1")
               if (dgTest != null)
                   for (var i = 1; i < dgTest.rows.length; i++) {

                       if (chkList[0].checked == true && chkList[1].checked == true) {
                           dgTest.rows[0].cells[0].style.display = "block";

Disable check box in a gridview does not working



I have a check box in a template field in a gridview.

Based on some condition, I want those check boxs to  be enable and disable.

I am trying the below code but does working..

 protected void GVstudents_RowDataBound(object sender, GridViewRowEventArgs e)
              if (e.Row.RowType == DataControlRowType.DataRow)
                    string studentID = GVstudents.DataKeys[0].Value.ToString();
                    int stdID = Convert.ToInt32(studentID);
                    int schID = profile.getSchoolIDByStudentID(stdID);
                    int tchrID = profile.getTeacherIDByStudentID(stdID);

                    if (patti.chkIsTeacherPaid(stdID, schID, tchrID))
                        CheckBox cb = (CheckBox)e.Row.FindControl("chkTeacherPayment");
                        cb.Enabled = false;
                        cb.Checked = true;


any help??

Gridview check all not working in Mozila Firefox


hi all,

i has an gridview first column header is Checkbox, when i click on that all the detail column checkboxes were selected if i use IE but the same not working in Mozila Firefox

below is my code

function checkAll()
                  var totalChkBoxes = parseInt('<%= gv5.Rows.Count %>');
                  var gvControl = document.getElementById('<%= gv5.ClientID %>');
                  var gvChkBoxControl = "cbCheckProd";
                  var mainChkBox = document.getElementById("chkBoxAll");
                  var inputTypes = gvControl.getElementsByTagName("input");
                  for (var i = 0; i < inputTypes.length; i++)

Dynamically creating Gridview Template - Linkbutton Click not working



I have written some code to dynamically generate template columns for gridview which works well. However, each cell in the gridview has to be a linkbutton, which when clicked does a db update and redirects to a specific url with some parameters in it.

I have attached a click event handler to the linkbutton in the InstantiateIn method but the event does not seem to fire.

Could someone please help? the code is below -

//Dynamically creating the Grid

protected void btnAnalyze_Click(object sender, EventArgs e)

Attempting to use an HTTP handler to display pictures in gridview. It's not working, please help.

I am writing a web page that needs pictures displayed for each item.  The page works just fine except for the pictures.  I have a file called handler.ashx uploaded to the server as well.  It does not seem to be hurting anything, but it doesn't seem to help display the pictures either!  I am working with a MySQL database so I am thinking that the call for the data or the ashx page's structure itself are my problem.  I am using C# Express so there is no generic handler class to autoload and therefore my handler page is pasted together and I know the using statements are in the wrong place, but I'm new to this and I'm lost!  The following is my database table info (table is named: Yamaha), my handler.ashx page code, and the code for the final web page.  I have loaded ".jpeg" or "jpeg" into the field I added called "Image_Type"  since I have already uploaded all pictures as longblobs.  You can view the final web page here: http://www.88867honda.com/YamahaPtsSale.aspx Thanks in advance for any help, Melissa   Table info: Field TypeAttributes--> Null DefaultExtra--> Comments part_number varchar(15)  --> No     -->   description varchar(50)  --> Yes  NULL   -->   qty int(4)  --> Yes  NULL  

Gridview rowupdated not working

hi frienz,After i click edit, i will get Update and Cancel button When I viewsource, I get this <input type="submit" name="GridView1$ctl07$ctl01" value="Update" onclick="javascript:WebForm_DoPostBackWithOptions( new WebForm_PostBackOptions(&quot;GridView1$ctl07$ctl0 1&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" / >&nbsp;<input type="button" value="Cancel" onclick="javascript:__doPostBack('GridView1','Canc el$5')" Cancel Works. But Update doesnt. Why? perhaps WebForm_DoPostBackWithOptions is not constructed properly. A Bug? Perhaps. So when I manually execute "__doPostBack('GridView1','Update $5')", it will call RowUpdating. Weird ! Why does this happen? but onRowupdating event not fired anybody can suggest methank u

Alert not working when used with image inside gridview

I am currently using following code to set alert on required column of my grid. When I change button type to Image the alert appear after completion action. Any quick suggestion??   My code is below.. protected void grdDelTempList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[6].Attributes.Add("onClick", "javascript:return confirm('Are You Sure?');"); } }    

The delete and edit buttons not working in gridview!

Hi everyone. I have problem with the buttons Edit and Delete in Gridview for very long time and i really need help about it.  So the when i click edit i get in edit mode and when click update the values in the row i was changing disappear but only in the gridview. When check in the Database nothing happens. The delete button not works at all, i mean when click on it only refresh the table. If see something wrong in my code please help. See how looks my page:Now here's my code in aspx:<%@ Page Language="C#" Title="Specific Search in Phone Directory" ... ... ... <asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:ThisIsMyConnection2 %>" OldValuesParameterFormatString="original_{0}" DeleteCommand="DELETE FROM [Resident] WHERE [MobileNum] = @MobileNum" InsertCommand="INSERT INTO [Resident] ([FNAME], [LNAME], [MobileNum], [HomeNum], [OfficeNum], [FaxNum]) VALUES (@FNAME, @LNAME, @MobileNum, @HomeNum, @OfficeNum, @FaxNum)" SelectCommand = "SELECT * FROM [Resident] WHERE (([FNAME] + ' ' + [LNAME] LIKE '%' + @FANDLNAME + '%'))" UpdateCommand=

After async postback, hide/show panel stops working

I have a Gridview in an UpdatePanel with a column containing an "expander" button that shows (and hides) more detail beneath its row of data.  It all works great until the user pages the gridview.  After the async postback to page the gridview, the javascript function to toggle hide/show appears to work flawlessly (the expander's button image even changes correctly), but the detail panel just doesn't show on the page.Note that my expander control supports a "AsyncTriggerId" property that, if set in the markup, will rebind the javascript toggle function when that control triggers an async postback (see OnPreRender below)Here's the hide/show toggle javascript:function toggleExpander(divId, imgId) { var div = document.getElementById(divId); var img = document.getElementById(imgId); var cssClass = div.getAttribute("className"); if (div.style.display == "" || div.style.display == "none" || cssClass == "hidden") { div.style.display = "inline"; div.setAttribute("className", ""); img.src = "images/dir_down.png"; mce_src = "images/dir_down.png"; img.alt = "Collapse to hide details"; } else { div.style.display = "none"; img.src = "images/dir_rig

javascript to hide ModalPopupExtender not working

Hello, I've seen some other posts about this but never found a resolution to it. I have a gridview control with another gridview inside each row. I'm using a masterpage and I have a TabContainer to boot and of course updatepanels. I'm showing my gridview child via a modal popup extender. It shows great and other JQuery operations are working as expected. I have a pageLoad javascript that does the following: function pageLoad(sender, args) {      $addHandler(document, "keydown", OnKeyPress);   } And, function OnKeyPress(args) {      if (args.keyCode == Sys.UI.Key.esc) {         var mp = $find('<%=mpe1.clientid%>');         mp.hide();      }   } The var mp seems to be returning an object as '<%=mpe1.clientid%>' returns the clientid, and the mp.hide() line executes without error. It doesn't hide the popup however. What can be the problem?S

have print friendly page, want to hide columns of gridview

using vb.net/asp.net 2005I have linkbuttons calling the javascript function at the bottom of this post to print out the contents of a div and this is working ok but theissue that i have is inside the div is a gridview that displays links and another text column (among other colums) and I would like tohide the links and the text column next to it using css.Has anyone done this?btw, here is the javascript print function# function printThisDiv() # { # try{ # var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; # sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; # # var sWinHTML = document.getElementById('dvTheDivIWantToPrint').innerHTML; # # # var winprint=window.open("","",sOption); # winprint.document.open(); # winprint.document.write('<html><body>'); # winprint.document.write(sWinHTML); # winprint.document.write('</body></html>'); # winprint.document.close(); # winprint.focus(); # # }catch(err){ # txt="There was an error on this page.\n\n"; # txt+="Error description: " + err.description + "\n\n"; # txt+="Click OK to continue.\n\n"; # alert(txt); # } }

gridview checkbox sorting not working

Hi All,I have a grid view which populates data just for viewing purpose(report) . One field shows the Active/inactive status for which I am showing a checkbox..if data in database is 1 then the checkbox will be checked otherwise it'll not be checked. This field is inactive so that the User does not check/uncheck it. The issue is that this field cannot be sorted. All the fields in the gridview are being sorted. Below is the code for the checkbox column. <asp:TemplateField HeaderText="InActive" SortExpression="Inactive"><HeaderTemplate ><asp:Label ID="lblStat" CssClass="copyLabel" Text="Inactive" CommandArgument="Inactive"                    runat="server"></asp:Label></HeaderTemplate> <ItemTemplate><asp:CheckBox runat="server" ID="chkStatus" Enabled="false"/></ItemTemplate></asp:TemplateField>I have given AllowSorting="True" in the gridview properties. The code in the gridview sorting event works fine for all other columns except the checkbox column. Please help and suggest some scenarios/links so that I can achieve sorting for the checkbox column also.Thanks in advance.

Gridview Delete not working

I just downloaded VS2010 with Framework 4.0.30319 I've bound a gridview control to a datasource, defined the select, insert, and delete SQL statements. Select and insert are working just fine thank you, but when I select the (auto-generated) Delete link, a postback occurs, but the row/record remains in the gridview. I have the one-segment key in the select statement, in an invisible column of the gidview. I've set the DataKeyNames property to this column name (CinID).  The delete query reads - DELETE FROM CallIn WHERE (CinID = Cid) I've defined the parameter Cid as the Gridview.SelectedRow, .SelectedDataKey, .SelectedIndex, and .SelectedValue, all with no joy. I created SUB Gridview.RowCommand put a breakpoint there. e.Command shows "Delete" and e.CommandArgument shows the correct row index (1). I created SUB Girdview.DeletingRow and put a breakpoint there. debug shows .SelectedRow=nothing and .SelectedDataKey=nothing (but I don't know if they *should* show something, since I'm not selecting, but rather deleting the row. The postback occurs (click), the grid refreshes, but nothing happens. I cannot figure out why the clicked-on row does not delete. Any ideas?  

Help:JAVASCRIPT (checkAll) & (Hide/Unhide GridView1) in a Datalist with a nested Gridview


Hey guys,

 I'm at my wits end on this one looked/Searched/Played/Experimented and I need your help if you can.

This page is going to be primarily used on a mobile device using Win Mobile 5


Need to Accomplish:

  1. Prevent Postback(serverside) of Page using JavaScript (Postback's slow down the page on mobile device)


JavaScript Requests:

  1. Hide and UnHide the Nested Gridview1 by Clicking on a imagebutton1 in DataList1icon_minized_collapse.pngicon_expand_collapse.png
  2. CheckBox in DataList1 Checks All and UNChecks All, CheckBox in just the related Gridview1


Controls :

  1. Gridview1 nested inside DataList1


Note: Datalist1 and Gridview1 have datasource's in production. The Codebehind page is just appling test data to help me figure this out.


Thank you all in advance for helping me with this.

Example data below:<

How can i hide selected rows from gridview


Can u tell me how can i hide selected rows from girdview using javascript.

how to hide a coloum in a gridview using jquey


how to hide a coloum in a gridview using jquey

  i have a table coloumn are


i require hide the coloum b2 how to do this

programmatically hide the Gridview selectbutton



I want to hide the select button in my grid view programmaticlly in the form startup.

any suggestions how to do this?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend