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
1
vote
0 answers

How to keep the selected page on gridview after a gridview operation

I have a gridview with huge data, as expected pagination is there. In the grid, i have three buttons, i.e, View, Edit,Delete When i am clicking View, it is showing details, but whenever i am clicking back button, it always takes me to 1st page of…
user5710892
1
vote
1 answer

Gridview dataBound add hyperlink to column data from code behind

Using grid view binding it from code behind: I want to bind a particular column data into a hyper link so when it clicked it should do a download. How to do that ? Below is my code : for (int i = 0; i <= tbl.Columns.Count - 1; i++) { …
Mike
  • 751
  • 2
  • 10
  • 25
1
vote
2 answers

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…
perkes456
  • 1,163
  • 4
  • 25
  • 49
1
vote
1 answer

asp .net RowDataBound RSS

i want a RowDataBound if the previous date in filed check in not found be red color like the date 10/10/2014 not found so 10/11/214 be red and how can i edit the date to be dd/mm/yyyy thanks for your help . Name Checkin Checkout…
Mohammed
  • 101
  • 7
1
vote
2 answers

How can I get the previous row in gridview rowdatabound?

I would like to check the previous row data if it is equal to --, if it is not equal to -- then I would enable button in the next row protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType ==…
dandy
  • 67
  • 5
  • 13
1
vote
2 answers

Can't Find Hyperlink of Cell during Gridview RowDatabound

I have a gridview that lists rows of information from SQL. If the late column is set to 1 it should display the text of the row in red. This works, however the hyperlink text will not be displayed in red. So I'm trying to a) change the forecolor of…
1
vote
2 answers

Populate DropDownList inside Grid Template Column

I have a dropdownlist inside a template column on a obout grid. Currently i am populating the dropdownlist on page load with a sqldatasource. However, i now have to load the dropdownlist dependent on the value of a certain column. For example: …
Alex
  • 67
  • 1
  • 10
1
vote
2 answers

Adding ComboBox to Datagridview

I found a way to add a combobox to DataGridview (Winform) cell, but I have not found an event like ItemDataBound of DataGridView to set a value to comboBox. And do not know how to set a selected value of a comboBox to DataItem property of a current…
1
vote
1 answer

How to add new rows to a DataTable which is bound to a gridview in the RowDataBound event?

I have a question regarding adding new rows to a datatable which is bound to a gridview in the RowDataBound event. Do you have any idea how can I do that?
1
vote
2 answers

Maximum value in a gridview column

I have a gridview which is databound to a sql datasource and displays data as it should but now I want to display the highest value in a column in a textbox. I have assigned the column to a literal called litPathwayDays. The column displays a…
stonypaul
  • 667
  • 1
  • 8
  • 20
1
vote
0 answers

Cannot set the selectedindexchange of two dropdownlist in gridview

I have three dropdownlist in gridview's template field. If the first dropdownlist has selected value in it then i am populating the other two dropdownlist with an array of listitem. Both the dropdownlist will have same items in them. Suppose I have…
1
vote
2 answers

Bind two Attributes["onclick"]

I got a GridView where I want to bind two events(?) when I click the first cell. Both events/onclick are in RowDataBound. First one gives me selectedindex so I can use SelectedIndexChanged and save row in Session. …
1
vote
1 answer

Adding cells at specific index

I have gridview with autogenerated columns.I have added a column dynamically in the row databound event. if (e.Row.RowType == DataControlRowType.DataRow) { TableCell cell1 = new TableCell(); e.Row.Cells.Add(cell1); } …
Shanna
  • 753
  • 4
  • 14
  • 34
1
vote
0 answers

Toggling CommandField ShowEditButton conditionally occurs on next line

I am trying to toggle whether or not a CommandField.ShowEditButton is true or false with the following code: protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { …
jhasell
  • 31
  • 4
1
vote
1 answer

How to enable column in GridView?

I've a ASP.NET GridView with the following data: Rows will be disable OnRowDataBound based on the value on column3. GridView :
sams5817
  • 1,037
  • 10
  • 34
  • 49
1 2
3
9 10