Questions tagged [rowdatabound]

1

votes
1

answer
11k

Views

Remove Gridview row in rowDataBound event asp.net c#

I have a gridview which checks some values on rowDataBound event.I want to remove some rows based on conditions checked in rowDataBound.I tried putting all controls in a Panel and hiding that panel ie, TRY 1 : protected void grdFeatured_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row...
sajanyamaha
1

votes
2

answer
1.1k

Views

Hiding dropdownlist in templatefield in gridview asp.net C# after insert into the database

I have a problem, I would like after the value from the dropdown list is picked up, inserted into the db I would like it to hide the dropdown list and just show the grade of the product that the user rated, as on the two following pictures: This is the first picture showing how the user needs to i...
perkes456
5

votes
1

answer
6.9k

Views

Background color of Gridview row on RowDataBound is not working in IE11

I have Grd_RowDataBound and I am applying back color to my GridView Rows. I have used below code which is working fine in Crome and Mozilla ,but not working in IE11.In IE11 my Gridview row back color is not working. protected void Grd_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row....
Genish Parvadia
5

votes
4

answer
19.3k

Views

How to check if any row is selected from GridView?

I have a gridview in aspx page: --- No Consumer Exists --- The rowDataBound Method is: protected void gdvMainList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gdvMai...
asma
5

votes
3

answer
35.5k

Views

How to access a gridview column on rowdatabound ?

I would like to change the value of my gridview column to active when the value is 1. I have gridview column like and cs code protected void gvCategory_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[5].Text=="0") { e.Row.Cell...
rematnarab
6

votes
5

answer
20.2k

Views

How to programmatically replace an HyperLinkField in a ASP.NET GridView

I have an ASP.NET Web Forms application. In my application I have a GridView that works smoothly. I have several text fields and the last one is a . Now I would like to programmatically change the field by placing a simple link instead of the hyperlinkfield if a specific condition is fulfilled. Ther...
CiccioMiami
3

votes
3

answer
16.6k

Views

Adding Control to Gridview Cell

I want to add a button on GridView cell on certain condition. I did the following in RowDatabound event if( i==0) { Button btn= new Button(); btn.Text = "view more"; e.Row.Cells[7].Controls.Add(btn); } When this executes, the text in the cell which is bound is lost and only the button appear...
Shanna
5

votes
2

answer
14.6k

Views

How to change in a Gridview on RowDataBound event the value of an Eval() field

I have a GridView: The Enabled property is a boolean. Now I would like to display Enabled/Disabled based on True/False of the Enabled property. Therefore I use: Sub gvDownloads_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles gvDownloads.RowDataBound If e.Row.RowType = D...
CiccioMiami
3

votes
2

answer
4.1k

Views

Gridview RowDataBound show hide column for each row

I have a gridview where I only want to allow a textbox to be editable if a certain drop down list item is selected. In my RowDataBound, I get the value and decide if it should be edited but the .Visible attribute is not working as I expect it to. Using my sample data, I would expect the first and se...
joerdie
4

votes
5

answer
12.6k

Views

How to avoid RowDataBound when GridView is edited?

Currently, I have the following code in the RowDataBound: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label groupID = (Label)e.Row.FindControl("idgroup"); LinkButton myLink = (LinkButton)e.Row.FindControl("groupLin...
aleafonso
2

votes
3

answer
325

Views

Show only the footer for inserting new row in Gridview in .Net 3.5

When my Gridview is bound with "few rows" of data, my current approach for adding a new row is an adequate design and works "well". However, if bound with "many rows" of data, my current approach for adding a new row is flawed: the EmptyDataTemplate I am using is exposed using the FooterTemplate. Th...
John Adams
3

votes
4

answer
15k

Views

Displaying a image in grid view based on condition

I am trying to display 1. Red if the TimeReceived is Null, (or) 2. Amber when Time Received is not null and Time Read is Null (Or) 3. Green When Time read is not null It throws an error Input string was not in a correct format. Description: An unhandled exception occurred during the execution of...
Mark
3

votes
1

answer
1.3k

Views

Showing specific rows using GridView.RowDataBound Event

Problem I have a Gridview bounded to a project table having one of the attribute as clientid and other attributes. Now i want to show only specific rows where clientid is equals to a given id. What I have got Change GridView row color based on condition 2.http://msdn.microsoft.com/en-us/library/syst...
Ankush Dubey
4

votes
3

answer
1.7k

Views

ASP.net Gridview highlight max values in multiple columns

I have a gridview that shows, for example, a baseball team's statistics. It's a standard sports stats grid - the rows show statistics for each player and the columns show the specific stat for the each player. Easy enough so far. But what I would then like to do is style (highlight or bold) the Max...
IMAbev
2

votes
3

answer
2.7k

Views

Dynamically created rows disappear from Gridviews on update/delete

Situation: I have several Gridviews on one page, and each Gridview has a dynamically created row to display the totals at the bottom. In each case, the totals row is created on a RowDataBound event. The strategy that I am using is like the one provided by Mike Dugan on his Blog. The following is t...
Karl Wenzel
2

votes
1

answer
12.4k

Views

How to loop through specific columns in gridview?

I need to loop thru particualr columns in a gridview. For example, I need to loop every "%" columns and then assign colors according to their values, is there a simple way to achieve it? Thanks. Gridview table RowDataBound event Protected Sub gv_ssi_rzli_data_1_RowDataBound(sender As Object, e As E...
user1672932
5

votes
2

answer
20.3k

Views

e.Row.DataItem error in gridview rowdatabound event

I want to enable or disable a particular row according to the related user logined. So i use rowdatabound event but i have an error in this line: DataRow drv = ((DataRowView)e.Row.DataItem).Row; In here, e.Row.DataItem has related row information. I have controlled and it has values of row. But whe...
rockenpeace