gridview

asp.net use details view if 1 record is returned and gridview if more than one record

I'm using a details view and a sqldatasource control to populate it. Every once in a while i get an error message because more than one row is returned. How can I have the data display in a gridview instead if more than one row is returned? ...

WPF: GridView with an "index" column

I have a standard ListView with a GridView. Now I want one of the columns in the GridView to be the 1-based index of that line in the list, as such: | # | First name | Last name | | 1 | John | Smith | | 2 | Anne | Anderson | How do I do that? ...

How to bind the gridview to treeview ,like tree structure hold the gridview data

Hi How to bind the gridview control to treeview , when user click for the + symbol the gridview has to display.. like tree structure hold the gridview data Thank You ...

Best practice grid binding

Hello, I have some experience in developing business logic and database logic and primarily work with C#. Now I would like to build my first data-driven presentation-tier in ASP.NET. I was just wondering how I should fill my DataGrids with data. I have IList - Collections of business entities such as "Customer" which I retrieve from my...

Is there an Attribute that hides a property from being bound to a gridview in asp.net?

I have an object that I set as the datasource for a gridview - this works fine, I get a nice table on the page with a column for each public property. But - I always want to hide one of the columns (but still need it available as a public property. I'm using a clunky hide-column-on-row-created fix for now, but am looking for a better s...

Gridview column reordering in Dynamic Data

I have a page showing results from database in a gridview in Dynamic data site. By default edit and details links are shown on left side of gridview. I have a peculiar requirement to show these links on right side of gridview. Is there any setting I am missing to acheive this or code modification would also help me. Thanks in advance. ...

Gridview: Keep style of SelectedRow

Hi, I change the styles of the rows normal, alternate and selected via stylesheets. Additionally I implemented onmouseover, onmouseoout and class with gv_Alternativen_RowDataBound. But when I do a mouseover in the selected row, the wrong onmouseout is placed there: Protected Sub gv_Alternativen_RowDataBound(ByVal sender As Object,...

LINQ query against GridView filled with SqlDataSource

I need to make a LINQ query against GridView filled with SqlDataSource - to create a Dictionary from rows. So I have: <asp:GridView runat="server" ID="gridCurrency" DataSourceID="sourceCurrency" OnDataBound="gridCurrency_DataBound" <asp:SqlDataSource runat="server" ID="sourceCurrency" ConnectionString="<%$ ConnectionStrings:MyConnStr %...

Hide Gridview Command Buttons

I have a gridview which has rows of 'tickets'. A user has the ability to 'claim' a ticket, this is all set up and works. What i need is to be able to change/hide the 'claim' button and replace it with a 'release' or 'open' command button. Can i achieve this at a rowdatabound level? What i do not want is to query the db everytime to see i...

control with ID 'GridView1' could not be found for the trigger in UpdatePanel 'UpdatePanel1'

I have two gridview in update panel and m adding entries from one gridview to another on selectedIndexChanged event what m trying to do is updating update panel on this event selectedindexchanged ...but my gridview is inside accordian control so it does not get initialized and hence i get this error ..... control with ID 'GridView1' co...

Convert RowData into GridView Columns through LINQ

I am currently working on a project where i need to show row data in gridview columns, so for example, if my data is in the following form. Username Jack Phone 2222222 Email [email protected] and i want to show this data as per columns in gridview as below Username Phone Email jack 2222222 ...

Converting Rows to Columns without loop

Hey, I have a situation where i have data like following User1 Address1 HomeAddress Address1Value User1 Address2 WorkAddress Address2Value User1 Phone1 HomePhone Phone1Value User1 Phone2 WorkPhone Phone2Value User2 Address1 HomeAddress Address1Value User2 Address2 WorkAddress ...

Multi-Column ListView

If anyone over here has used Kaspersky Internet Security 2010 you'll realize that the Report View has got several columns that can be expanded to reveal more columns (like subcolumns). Is there any place I can a UserControl with such functionality? If there is none, can anyone give me some pointers on how to design a UserControl which h...

Bound DropDownList of "unused" items plus current row item in EditItemTemplate of GridView?

I have 2 tables with unique IDs that can be mapped to each other (one table comes from a database outside of my application but has information about the same entities I'm tracking). I want to provide a UI for linking "my" records with the "other" ones, so I can store the "other" IDs in my table for the matching records. In a nutshell, t...

how to clear GridView

I have 3 GridViews in my page. Using the SelectedIndexChanged event I put GridView2 and GridView3 data in GridView1 but when I restart my application GridView1 data is still persisted in browser. I used a session variable to store the data. How can I clear GridView1 ...

Overriding the editindex after a GridView update

I have a GridView control hooked up to a datasource that I allow row editing on. I use the standard edit/save/delete buttons that point to the Update, Cancel, and edit GridView commands. I would like to add an additional button, "Next" inline with the save/cancel button. This would function the same as the save button, but would ...

ASP.NET GridView.DataBind not refreshing the GridView

To start I am using a MultiView control to step users through searching. The first page in the MultiView is just a search box with a button to preform the search. The second page has the GridView, but I would like to keep the search box and button for the user to search again if they didn't find the user they were looking for. When yo...

how to clear gridview

I want to clear my gridview. I have 2 GridViews and Has Select Button On It. on Selecting this button that item goes into the second gridview. now the question is how should i clear the second grid view. I am trying the clear method but clear method is not found in my visual studio.. ...

binding int values from server side - asp.net

Hi All, Quick question here. I'm sure it's possilbe, just can't get it to work. I've got a gridview. In have a gridview. The gridview is bound to a list of my custom class. The class exposes a link to an image as well as the image's height and width. I have a Image Control in the gridview. I've bound the Image Url to the correct propert...

A Problem with changing width of a gridview column

I have a datatable binded with gridview and I want to change the column width. This it the code I use: DataTable aTable = new DataTable("Words"); aTable.Columns.Add("word"); GridView1.DataSource = aTable; DataRow a = aTable.NewRow(); a[0] = "test"; aTable.Rows.Add(a); GridView1.DataBind(); GridView1.Columns[0].ItemStyle.Width = Unit...