gridview

Modify Asp gridview boundfield

I want to add some text to a boundfield build in the code behind without writing any code in the code behind. example I receive "overflow" in a specific field, and i'd like to display "stack overflow" and if i receive "house" i want to display "stack house" is there a property to put text behind or after whatever comes in the boundfiel...

Image from dataset in ASP gridview

I receive a certain image name in a boundfield (i have two images in the same folder) and it comes from testing in the codebehind and binding a datatable into this gridview. example: it comes as "image1.jpg" or "image2.jpg" I'd like this text not to be displayed, instead, i want these images that are in /folder1/folder2 of my solutio...

Gridview loses its viewstate

Hi, In a page, i put a gridview with several template field columns. In one of the template field, i have a linkbutton. Before postback i bind the grid with data. Once page loads, when i click the linkbutton in gridview, it is not firing the related event and its return a empty aspx page. ...

ASP.NET Dynamic User Controls

I'm sure this question has been asked a million times, however I haven't been able to find an answer that solves my problem. I am programmatically adding some custom user controls to a PlaceHolder which I have on a simple aspx page. All of the user controls Postback's work correctly except for one which has a Gridview on it. For some r...

Get Header Text of Gridview Cell

I've a gridview in my web form and I'm using a the following code in my web form's Save button: foreach (GridViewRow row in gvList.Rows) if (row.RowType == DataControlRowType.DataRow) { for (int i = 0; i < row.Cells.Count; i++) { string headerRowText = ???; How can I get the...

How to hide columns in an ASP.NET GridView with auto-generated columns?

GridView1.Columns.Count is always zero even SqlDataSource1.DataBind(); But Grid is ok I can do for (int i = 0; i < GridView1.HeaderRow.Cells.Count;i++) I rename request headers here but GridView1.Columns[i].Visible = false; I can't use it because of GridView1.Columns.Count is 0. So how can I hide them ? ...

Truncate text in RadGrid column

Hi, using Telerik RadGrid* in a LINQ context, with ASP.NET/C#, how to truncate text to a maximum length when displaying in columns? By maximum, I mean if original string's length is shorter than the specified maximum length, no errors will raise. I have seen many examples of this on the net, but it seems that the Container.DataItem use...

ASP.NET - SQLDataSource - FilterExpression - Problem with Empty Strings

In this test application, I am filtering by two ControlParameters. As you can see in the first codeblock, both parameters have a default value of %. This code works great. However, in the second code block, please note that the Default Values are eliminated. The second code block works as long as neither Textbox's text is blank. For some...

ASP.Net GridView - Update Row Command does not revert back to display-only

I have a GridView that is populated from a LinqDataSource. When I update a row, the RowCommand fires and the change is persisted to the database, but the Grid does not refresh. I have it in an UpdatePanel and explicitely call Update() in the RowCommand handler, but there is no postback and the page just sits there in Edit mode. Once I cl...

access Gridview attributes in javascript

I want to change the font size of my gridview in javascript because i am creating a printable version. How can I change the font size in javascript for the gridview? ...

How to prevent from closing out-gridview when a script finishes

I have a script that presents results using out-gridview. Here is a simple example: "hello world" | out-gridview When I run the script using Run with PowerShell, it will open gridview and close it immediately after it is opened. (I think this is because gridview is not modal and the script finishes.) How to make the PowerShell wait u...

Telerik Radgrid WPF

Hi, My WPF page has a RadGrid control provided by Telerik. The Grid is a nested grid which essentially means that clicking on the (+) sign on the leftmost column of the row expands the row into a Subgrid. This is being done by specifying a hierarchical grid in my XAML. Everything works just fine when you click on the row and expand the ...

Gridview tooltip inserting index or check cell for value

Hello all Trying a different approach for tooltipping on a gridview using the following code: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { { if (e.Row.RowType == DataControlRowType.Header) { foreach (TableCell cell in e...

ASP.NET Gridview - setting column header's css class from code behind?

Hey guys, what I am trying to do is add a method to my gridview's sorting event to add a class to the column being sorted so the user can know if the data is being sorted ascending or descending and on what column. I am currently trying to do it through a switch statement on the sort expression to determine what column it's coming from b...

How to set the RowStyle of a GridView row depending on a property of the Object that the row is being bound to.

I'm currently using a GridView and I want to set the CssClass for the Row depending on a property of the object that the row is being bound to. I tried the following but it does not work (see comments): <asp:GridView id="searchResultsGrid" runat="server" AllowPaging="true" PageSize="20" AutoGenerateColumns="false"> <!-- The following ...

Display GridView with many columns as two sets of columns

I apologize for the odd title. I've been trying to figure out how to do this and can't quite put it into words. Basically, I need to try to display a GridView with a whole bunch of columns (37 in one case) in two "rows" of columns. More or less. So instead of this: Column1 Column2 Column3 Column4 Column5 Column6 Data Data Data ...

Binding the Checked Property of a CheckBox within a TemplateItem

For the life of me I cannot bind the Checked property of a CheckBox control within a TemplateField (declaritively). I have tried: <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="deactivated" runat="server" checked="<%#Eval("Deactivated")%>"></asp:CheckBox> </ItemTemplate> <...

Saving a batch of changes from a DataGrid or GridView

I have a set of data that has been displayed as just a simple GridView with the item name being a hyperlink to view details. I'm attempting to update this scenario so certain fields (sortOrder and isApproved) are editable from the main page and do not require visiting each item in the grid. I have converted the GridView to a DataGrid a...

asp.net panel hight issue in IE7

Hi, I have an asp:panel and a gridview inside the same panel. (Gridview has paging implemented in it). In IE6 everything is working perfectly. But in IE7, last gridview row comes below the panel..i mean it overflows :( Please help me . ...

Disable the Row according the Checkbox in Gridview.

I have gridview with a checkbocx templatefiled as first column. I want to disables the current row if user unchecks the checkbox. How to do this? ...