Questions tagged [rowdatabound]

Occurs when a data row is bound to data in a GridView control. Contained in the namespace System.Web.UI.WebControls

According to Microsoft Developer Network:

  • Detail of RowDataBound event

    The RowDataBound event is raised when a data row (represented by a GridViewRow object) is bound to data in the GridView control. This enables you to provide an event-handling method that performs a custom routine, such as modifying the values of the data bound to the row, whenever this event occurs.

  • Syntax (C#)

    public event GridViewRowEventHandler RowDataBound
    
  • See example here:

139 questions
0
votes
1 answer

if condition not behaving the way I expect

I have a gridview with a boundfield that contains DateTime columns. In the OnRowDataBound event I check if that date is NOT NULL and depending on the result I do some action. if (!String.IsNullOrEmpty(e.Row.Cells[16].ToString())) BUT, even though…
Barnabeck
  • 459
  • 1
  • 6
  • 26
0
votes
3 answers

Error: Specified argument was out of the range of valid values. in RowDataBound Gridview

I want Bind data gridview and change data '0' to '-' . but error: Specified argument was out of the range of valid values. Parameter name: index Code asp
nettoon493
  • 17,733
  • 7
  • 30
  • 45
0
votes
2 answers

Hide gridview cell (value) base on other cell value

I have a Gridview with ItemTemplate using some Labels and 3 Button (Deactivate, Delete and Edit) as seen in picture below: I want to hide these buttons from some users base on their username (Label UserName on Gridview), for example: If UserName…
Ronaldinho Learn Coding
  • 13,254
  • 24
  • 83
  • 110
0
votes
2 answers

Gridview datacontrolrowtype not recognized as datarow

I am trying to learn how to put totals on my gridview and have been searching for 2 days to find why mine don't work. The onrowdatabound event fires, but it doesn't recognize the rows as datarows, it only picks up the footer (I added a textbox and…
0
votes
1 answer

Calling RowDataBound Event when the page is refreshed

I am having a gridview and I am binding it only if it is Not POSTBACK, But I want to call the function RowDataBound when it is postback. How can I do that protected void gridview1_RowDataBound(object sender, GridViewRowEventArgs e) { if…
hello temp11
  • 141
  • 4
  • 17
0
votes
1 answer

can't find control by id during RowDataBound

i created a dynamic gridview and want to assigned the rowdatabound and SelectedIndexChanged to the gridview. below is my code HTML
C# protected void Page_Load(object sender, EventArgs e) { if…
user3431239
  • 267
  • 1
  • 4
  • 20
0
votes
1 answer

Dropdown list inside gridview binding for alternate rows on Rowdatabound

I have DropdownList inside gridviewin EditTemmplate which I am binding on RowDatabound. But DropdlownList is binding for alternate rows only. For Example, For first row its binding, not for 2nd, for 3rd it is, and so on. Below is my code: …
Ubaid Ashraf
  • 1,049
  • 5
  • 15
  • 43
0
votes
1 answer

asp Gridview column becomes not editable after changing the text in OnRowDataBound event

I use a GridView to display and allow for modifying data. But instead of directly using the data in the database, I have to convert them (consider switching between different date formats), so in the RowDataBound event I update the Text field of one…
Alfred Huang
  • 433
  • 6
  • 13
0
votes
0 answers

Invalid attempt to call Read when reader is closed. in Rowdatabound event while reading

I want that my Reader result object fetch matchinng id which matches q=with 2 tables and then get result and save it. and then row data bound function match with all grid and if match on any row it Checked checkbox of that row { if…
0
votes
1 answer

Locating dropdownlist inside of asp.net gridview template field in C#

So i have this gridview as shown below:
perkes456
  • 1,163
  • 4
  • 25
  • 49
0
votes
0 answers

Duplicate Values in Gridview if on different page of the gridview

I am having a Gridview with 1 checkbox column and 3 other columns. To 1 colums I am adding values from a TextBox on ButtonClick. I want that duplicate values should not displayed in the gridview for which I have added code in Rowdatabound. The…
Aditya
  • 73
  • 9
0
votes
1 answer

Format cells in gridview boundfield columns without use of hard-coded cell index numbers

I'm wanting to know if there might be a better way to format cells in my gridview than my current technique. Gridview is bound to a collection class of EventItem objects. (various snippets follow): If e.Row.RowType = DataControlRowType.DataRow Then …
John Adams
  • 4,773
  • 25
  • 91
  • 131
0
votes
1 answer

RowDataBound how to print multiple labels

I am trying to calculate the date difference between two dates and want to show them in grid. I have created a table in the grid and the results can be printer there. My RowDataBound is calculating everything but don't know how to print the…
Shami
  • 3
  • 3
0
votes
3 answers

How to get selected item from Dropdown in GridView?

I have a GridView. Whenever I'm clicking on the LinkButton after selecting the Dropdown value, I'm getting only the first item of the Dropdown. I need to show the selected value in TextBox. How can i get the desired value ? This is my pseudo…
user3398663
  • 113
  • 8
0
votes
0 answers

RowDataBound event on GridView in ASP.NET

I have a gridview that contains a checkbox and a textbox. My objective is to disable the textbox as long as the user hasn't check the checkbox beside it. I am using RowDataBound Event but I think I'm missing some steps. This code is not firing.…
lulutanseco
  • 313
  • 1
  • 8
  • 29