gridview

how use gridview as parent and detailview as child

i have two database both are two only two columns. gidview and detailview connected with each one datbase. i want to display detailview with bind database when i m select item of gridview. ...

Setting Column Background in WPF ListView/Gridview

I'm looking to set the background of a column in a WPF GridView. Many Google results have pointed towards setting the GridViewColumn.CellTemplate to change the appearance of a column. However, I'm met with an issue when setting the background color; it's not stretching to fill the cell: Here's the xaml I'm working with: <Window x:Cla...

Subsonic and gridview control delete

Does anyone know how to use the gridview delete functionality with Subsonic 3? I am trying to delete rows that do not have the primary key displayed in the the gridview so I can't just pull that data from the gridview row. I was wondering if there is a way to do it with the DataKeyNames property. Thanks.. ...

Make a new line in a GridView

Hi, I've an ASP.Net 2.0 Gridview control that I can bind a List<T> too, for a specific field in List<T> like "Old" and "New" I want to place new line characters that will break the text into separate lines e.g.: Column1=Value1 Column2=Value2 to become: Column1=Value1 Column2=Value2 ...

Gridview and visited items

Hi, I have a asp gridview which shows some properties and links to another page. When the user is seeing the gridview I would like to highlite the whole row (not just the link) for those rows where a user has clicked the link before. I was thinking about onclick to save the id of the row in a comma seperated cookie, and the OnItemDataBo...

Internal workings of gridview control? how to create custom (databound) controls

I want to know complete life cycle of gridview control (control's life cycle) in context with the page life cycle. What all events are fired. How the data gets bind (i mean which events are internally fired and when are they fired). Actually i am looking to create the repository of complex custom controls (required in day to day life)....

How to get proper row index values of grid view after sorting

Hi, I have an asp.net application in which I am using a grid view. Paging and sorting are applied to the grid view.One action what I am doing is on click of any grid view row, am getting the column values of the selected row and redirecting to the other page. The problem is after the grid view is sorted,if I click on any of the row in ...

Winform DataGridView: how enhance DataGridViewCheckBoxColumn?

Hi! I'm looking for a full example where a DataGridViewCheckBoxColomn and DataGridViewCheckBoxCell are extended so that the Checkbox control itself can be accessed. My goal is to redifine the Databinding for each cell. Thanks for you help ...

Asp.Net GridView get current row on TemplateField

Hi I have a gridView binded to a data source, and I have a ButtonField as one of the columns in the grid to perform a custom action. When I use the ButtonField, the CommandArgument of the event raised by it has the zero-based index of the row containing the clicked ButtonField. I want to convert the ButtonField to a TemplateField so I...

Bind to a property's property

I have a List (Of MyObject) binding to a GridView in the Page_Load event. MyObject has a child object as a property, ChildObject which also has a property itself, ChildProperty. In my GridView, I would like to bind one of the fields to ChildProperty, but doing something like: <asp:boundfield datafield="ChildObject.ChildProperty" /> ...

Paging with in a time interval

Hi is it possible to fire pageindex changing event of a gridview with in a time interval? Actually i tried with some code but it is showing page event args e not exist. How do i call this event in a timer tick in asp.net c# application? thank you ...

How can I display different ContextMenus in WPF ListView GridView?

I have a ListView GridView with ListViewItems that represent different categories of items. I'd like to display a different ContextMenu for each category of item. I was hoping to do this using DataTemplates but I'm struggling. My TreeView has a DataTemplate per category and I can see how I can set a different ContextMenu for each ther...

Gridview - Adding of column

Hello, My question is: Can I add in new column(S) in the gridview if the column is not found in the database? - E.g. An indicator if a certain lecturer is a ML/Lec (roles). I have a gridview that is "extracted" out from the database. But I want to add in a new row which is not in the database but links to the data in the database. Fo...

ASP.Net GridView GridViewDeleteEventArgs.Keys empty

I have following Gridview: <asp:GridView ID="GridView1" runat="server" CssClass="table" DataKeyNames="groupId" DataSource="<%# dsUserGroupsSelected %>" DataMember="Group" etc....> and after firing RowDeleting event handler: protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) e.Keys is empty. Mor...

ASP.Net CustomValidator in GridView is not fired

I got a Gridview in an UpdatePanel with this EditTemplate: <edititemtemplate> <asp:textbox id="txtDistFrom" runat="server" text='<%# Bind("distFrom") %>' width="30" /> <asp:CustomValidator ID="valDistFrom" ValidateEmptyText="True" OnServerValidate="valDistFromTo_ServerValidate" ControlToValidate="txtDistFrom" Text="Missing" Tool...

Convert GridView to Object During Postback

I have a GridView inside of a User Control populated from a List of IObject. I need to get the contents of this GridView so I can export the data to CSV. I was just passing the whole GridView to the procedure and looping through it to get the data I needed. I am using MVP though, and was told this was a bad approach. I want to conver...

Selected row does not change after a GridView sort

I'm having an odd issue with the GridView. I set up a Select column, and allow sorting. If I select a row, then sort the grid, the selection stays in place and the grid sorts. That is to say, the highlighted row is changed, but the index of the selection doesn't seem to. Looking at the grid in a watch, it seems like the selected in...

How do I set the color of the horizontal lines between rows in a asp.net gridview?

Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the css border controls and can't set the color of the horizontal line between rows in an asp.net gridview. The color of the line seems to be defaulting to white. The only way those rows are visible are if the background color of the gridview is set to a da...

ASP.Net Gridview: get rid of redundant controls in templates

In a gridview I want to allow editing and inserting data. The Insert row should be in the footer row. But that row is not existing if the datasource is empty. So I have to create an emptydatatemplate and repeat all of my controls. Together with the edittemplate I have the same set of cells and controls three times, like this examples sho...

Editable gridview - what are the basics?

I'm trying to create a simple example of an editable gridview, and for some reason can't seem to get the basics working. Why is this example not displaying the label Bar and a textbox when I click on "edit"? aspx: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="gv.aspx.vb" Inherits="WebRoot.gv" %> <!DOCTYPE html PUBLIC "-/...