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

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

gridview find invisible row from code behind

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

hi all,

let me explain completly. I designed an gridview, header template i added one textbox and button if the user enter something on Txtbox and click button then based on input i show corresponding rows only, all other rowss will be hidded using Javascript like below

tblOrders.rows[CurrRow].style.display = 'none';

now im doing something on the Gridview_RowCommand event at this time the gridview got refreshed so that the hiden rows are visible, but i dont want to show the hidden(invisible) rows while rowcommand event fired. so, is there any way to solve this issue?

experts please help me to resolve this...........!

View Complete Post

More Related Resource Links

find a Control inside a GridView using jQuery


I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!

here is the code page: 

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">

Code Reviews: Find and Fix Vulnerabilities Before Your Application Ships


Code defects can be found using many approaches, but manual code reviews stand out in terms of precision and quality. We provide some best practices for planning and executing code reviews on your own team.

M. Chmielewski, N. Clift, S. Fonrobert, and T. Ostwald

MSDN Magazine November 2007

Toolbox: Find Bottlenecks, Code Similarities, and More


This month, find performance and memory bottlenecks, essential security reading, and more.

Scott Mitchell

MSDN Magazine July 2007

Are You in the Know?: Find Out What's New with Code Access Security in the .NET Framework 2.0


Unlike role-based security measures, code access security is not based on user identity. Instead, it is based on the identity of the code that is running, including information such as where the code came from. Here Mike Downen discusses the role of code access security (CAS) in .NET and outlines some key new features and changes in CAS for the .NET Framework 2.0.

Mike Downen

MSDN Magazine November 2005

GridView Code Suggestions



I have a gridview which displays data from a database.

Everything works fine, the thing is that I haven't come with a method to do the next thing:

The gridview displays something like this:

Client - Total - Percentage

Ex1      1000    20%

Ex2      2000    40%

Ex3      1000    20%

Ex4      500      10%

Ex5      500      10%

This data might vary depending on the month selected etc etc....

What I want to do is that the gridview kind of check its rows and start summing the percentaje, when it sums 80% I want to color the rows that sum the 80% to one specific color then the rest of the rows  leave them with the default color or change it too.

I'm thinking that I might be able to do that with the row data bound event, but I just can't find the answer to do it, I know how to iterate through the rows to sum the values but then how I can tell it to stop if it reaches 80% and color the rows that completed that 80%.

Another thing, the rows that complete this 80% of course have to be the ones with the greatest percentages. In the example above it would be Ex1, Ex2, Ex3. That 80% percent can

Where can I find the code of the Twitter or Facebook or WebGrid helpers?


Just in general, where can I find the code to take a look at and learn from them? Or at least look at the functions available to me as I do get the feeling that the insufficient documentation at the moment reveals all.

How to Find out Windows service application path from Code ?

Dear frnds, Could you please help me to find out the path of  windows serivce exe ( application path ) from code?   Regards. Sajid P K  

Get Text Value in Gridview from Invisible Field

Hello,  I've run into this before, but I was using a formsview and just changed the field to hidden.  If you've seen my previous post I am trying to get the value of a cell out of a gridview to a variable and here is the code: Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged Dim varClientID As String = GridView1.Rows(GridView1.SelectedIndex).Cells(6).Text.ToString() End Sub This works perfectly if column 6 is visible, but because it's an id number (which is not the primary key) I do not want it visible, but changing it to visible="false" causes this code to return null.  Changing it back to visible and it works.I'm not sure why the visiblity of a control changes the functionality of it.Are there any other ways to get this data out?

How to find specific nested object type in Gridview

Dears, I have a gridview with a nested placeholder in each rows. I nested some checkboxes in each placeholders in each rows dynamically, so their ServerIDs are not the same (I dont want to use nested gridview). at the end in a button event I want to count checked checkboxes in gridview while I can not use findcontrol() method in each rows to find checkboxes due to their different ServerIDs. How can I do this?

Display UTF-8 code in GridView

Hi, I have a table in database, all table is utf-8 character set, one column is Italian another is Russian. I put as sqldatasource in a webform, correctly made the connection string. To show data from table i use GridView. Problem is that russian characters are not displayed correctly and some Italian characters, those with stress, for example "è" is not displayed correctly true. I put <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/> in web.config file but no result and font selected for gridview is "Arial" Could you please help me? Best Regards     

find the label control of gridview in save button event in C#

hi, every one..i want save the gridview in buttonsave event..here i wrote the code like thisfor (int i=0;i<gridview1.row.count;i++){label lbl=(label)gridview1.rows[i].findcontrol("lbl");Textbox txtname=(Textbox)gridview1.rows[i].findcontrol("txtname");}here i got the textbox value but am not getting label value how to get that label value..thanks in advance

More illusive code (an inline style I can't seem to find)

I just *thought* was done. The issue is with the tree view in a document center. So with the help of the IE Developer Tools, I've managed to narrowed it down to an inline style but it doesn't tell me where that inline style resides (unlike everything else listed).  The culprit is a font-size:1em. The code in the source is: <td><img src="/_layouts/images/tvblank.gif" alt="" /></td><td><a href="javascript:_spNavigateHierarchy(this,'TreeViewDataSource','30:ListNode:df253e52-42eb-498a-8fc9-7bfabf220bfb:bbd65828-90c9-4b75-b4a8-ac304d01744e:160e6be3-d556-4fb9-887e-c1204f716aab','\u002fit\u002fPMO\u002fIntranet\u002fDocuments',false,'ListNode')" title="Documents" id="ctl00_PlaceHolderLeftNavBar_WebTreeViewt0i" tabindex="-1"><img src="/_layouts/images/itdl.gif" alt="Documents" style="border-width:0;" /></a></td><td class="ms-navitem ctl00_PlaceHolderLeftNavBar_WebTreeView_2" style="white-space:nowrap;"><a class="ctl00_PlaceHolderLeftNavBar_WebTreeView_0 ms-navitem ctl00_PlaceHolderLeftNavBar_WebTreeView_1" href="javascript:_spNavigateHierarchy(this,'TreeViewDataSource','30:ListNode:df253e52-42eb-498a-8fc9-7bfabf220bfb:bbd65828-90c9-4b75-b4a8-ac304d01744e:160e6be3-d556-4fb9-887e-c1204f716aa

Javascript code to copy specific cell of gridview row

Dears, I need a javascript code to copy the text content of a cell of a row in gridview. I have a button in each row that users click it and the text content a cell of that row should be copied in a textbox out of gridview

Find a gridview row by keyfield value

Hi All,   I have 2 Tables Branches and UserAssigned branches. I use a Gridview and bind a datasource from the Branches table to display all branches on the Gridview. Next,  I want to mark the branches which are assigned for a user (using checkbox field on gridview item template) as checked. I have a List<UserBranches> which contains a list of BranchIds assinged for a given user. Now to check those branches on the gridview, I need to find the rows with the same branch Id as the ones in the list. Is there anyway to do this without using foreach (Gridview row in gvBranches){} becasue I'm afraid I have to use 2 inner loops - one to iterate through the items in the list and one to iterate through the Gridview rows. Instead, I was wondering if I could do the following way: foreach (int branchId in UserBranchList) { //find the gridview row with the Key branchId //get the checkbox in the row and mark it checked } is this possible? If so please tell me how to do it Thanks

WPF : Find a control in GridView

I have googled a lot to find the answer to my question but no suitable answer could be found. I am using a gridview of wpf tool kit. which has multiple columns  column structure is like,   <my:DataGridTemplateColumn MaxWidth="15" MinWidth="15" Width="15"> <my:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button Click="btnContractCollespe_Click" FontSize="9" Height="20" Name="btnContCollespe">+</Button> </DataTemplate> </my:DataGridTemplateColumn.CellTemplate> <my:DataGridTemplateColumn.CellEditingTemplate> <DataTemplate /></my:DataGridTemplateColumn.CellEditingTemplate> </my:DataGridTemplateColumn> <my:DataGridTemplateColumn> when grid renders it displays button "btnContCollespe" in each row. I want some how I could change contents of every button in all rows. Basically this button will expand and collapse gridview 3 fixed columns. so upon expand operation, buttons in all rows should have content "-" and after user performs collapse operation, all button content should change to +. I found no suitable way to find control inside grid. Can anybody help. In asp.net we used to do it by gridview.findcontrol("...") but no such method is available in WPF gridview. please provi

find control in datalist by javascript(Not by Code Behind CS Page or ItemDatabound)


Hello all,

I am facing a problem with javascript.Following is the scenario:

I am working on survey application......

I have taken a datalist in which the question in survey are bound in a label control

now user can change color of the question using color picker

color picker have a popup which is closed when user selects a color and

the color of question will be updated as popup closes

So i have to find label control(in which i bound questions)

in datalist by javascript only (not by Cs page or by itemdatabound event because of color picker popup i can not use cs page)

and update the color of label selected by color picker

I googled and found following code but it show null value

var lbl = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("dList").FindControl("lblQuestion") %>');

when I saw the page source following id is generated for label

and so on


Where to find code samples for Microsoft® SQL Server® 2008 Analysis Services Step by Step



I got this book  Microsoft® SQL Server® 2008 Analysis Services Step by Step by Scott Cameron, Hitachi Consulting from our tech Library , however the companion CD is missing. Can anybody share the CD / practice code examples with me please? The book is only useful if I get to practice the code alongside reading the theory!



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