gridview

Get DataItem when updating GridView

How can I get the underlying DataItem from a GridView row that is in edit mode and the user clicks on "Update"? I have an editable GridView. I've added a CustomValidator to the Edit view of one of the columns. When the user clicks on Update I run a server validate method and need to get the underlying DataItem of the row being edited ...

How to add checkbox column to a gridview within a MasterPage? (Or, how can I convert a LiteralControl to Checkbox)

Hi, I have a gridview that I have added a checkbox column using a templatefield (I want the user to be able to check/uncheck the box. I want to be able to populate the checkboxes, but when I try to cast the column as a Checkbox on the RowDataBound event, it errors. I also can't do a FindControl due to the Masterpage (I think) Any help...

Alternative to GridView that sorts, pages and is cheap or free?

I've been spoiled by the SqlDataSource, but I'm in a scenario where I can't use it. Is there an alternative to GridView that implements sorting and paging for arbitrary data sources? I'm trying to avoid writing 1000s of lines of custom paging and sorting for each grid. At the office I use Telerik's grid, but for my hobby project, spend...

Getting row index from an ImageButton click in a GridView

I have a Gridview with ImageButtons added to a column via a templatefield. I've attached a function to the "OnClick" event. Once in this function, how can I get the index of the row that has the button that has been clicked. It appears that all I have is the mouse coordinates on the page. ...

Is it possible to display a panel or div in between gridview rows on RowCommand event

Hi, Currentaly I am using a gridView and on RowCommand event of gridview the details of selected row are displayed below the Gridview. But now I have to display the details just below the row clicked. Means it will be displayed in between the selected row and next row of it. The gridview code is as <asp:GridView ID ="gvUserDataRead...

Updating a gridview based on dundas chart callback

I have a dundas pie chart which when clicked issues a client callback which updates another chart associated with it. Basically its like a drill down thing. I also want to update my gridview based on the user's selection of the pie. But since the update of chart is being done using dundas client callback I'm unable to rebind my Gridview....

highlighting gridview rows for striped gridview from checkbox

Within the gridview I have, I'm trying to make it so when the user checks a check box for the row the row is highlighted. Now, this GridView is striped (meaning even rows have one background color and odd rows have another). This code to do it is floating around the net in various forms... var color = ''; function changeColor(obj) { ...

Best way to implement save field in DataGrid when user tabs out or field looses focus

I have a page with .Net grid view with about 12 text fields per row and about 250 rows. Right now there is a save all button at the bottom of the page that sends all the fields 12x250 to the server where they are entered into db 1 by one. Which ends up being very slow and some times does not go through at all. I didnt come up with this ...

How do I get the current row of a GridView from a Buttonfield click?

I have an ASP.NET GridView with a DropDownList (in an Item Template) and a ButtonField. <my:GridView AutoGenerateColumns="false" ID="CurrentCardGrid" UseHighlights="False" runat="server" Width="100%"> <Columns> <asp:BoundField HeaderText="ID" ItemStyle-Width="50px" DataField="Id" /> <asp:TemplateField HeaderText="" ItemStyle-Width...

GridView is scrolling back to top after row selection

I've got one long GridView control on ma website. It allows row selection. The problem is, when I scroll down this GridView and select some of the bottom rows the selection occurs, but whole GridView is scrolling back to top. Does enyone know how to avoid this? ...

GridView .DataBind RowDataBound not firing

hello - i hope someone can help! i have a user control that has a gridview (there is an update panel in the UC) i'm using this UC on 2 different pages - on both pages, the UC is on a tab (ajax tabpanel) with the tab being inside an update panel. on 1 page, when i use the .DataBind() (not initial load), it fires the RowDataBound event a...

Gridview Paging

I've got a gridview that is bound to a dataview in the codebehind. The datasource is actually powershell, so I'm processing the data myself. This works fine and displays the result how I want. However, when I try to enable paging, I get this error when opening the page: The table must contain row sections in order of header, body, the...

Different Images in a gridview

I have a question related to gridviews in ASP.NET I have a gridview that I pull information from a SQL db and it displays the username and current status IE; Username | Status user1 | Logged Out user2 | Logged in user3 | On Leave So this is working all handy dandy, however what I'd like to do is rather that display ...

Dynamic gridview delete button not showing

I have an ASPX page that is dynamically creating a gridview from a database table. Each time the gridview is created on postback, I set the AutoGenerateDeleteButton attribute to true. However, the first time the gridview is created the delete button isn't displaying. I wrote the value of AutoGenerateDeleteButton and it is True. When ...

Get the Current Selected Row of GridView on a button Click

I want to fetch the DataKey of the Selected Row of GridView on button click. ...

Visual Studio 2010 - WPF / Silverlight and built-in Grid

I haven't had a chance to look at VS2010. Is there a built-in Microsoft Grid for WPF or Silverlight yet? ...

how to customize datalist to be like this?

in asp.net how to customize datalist or gridview or what ever from data tools to be like this picture http://picasaweb.google.com/lh/photo/YYaQAfXEKz3ufb0tSlxPoQ?feat=directlink ...

Applying Existing Tablestyle to a Gridview

I'm working on a web-enabled version of our existing winforms project. Gridviews seem to be an ample replacement for the datagrids that we've been using. We have extensive table styles written for the old datagrids. Is it possible to reuse this code to apply a style to a gridview? If a re-write is necessary, what is the best way to s...

Why isn't the SelectedIndexChanged event firing from a dropdownlist in a GridView?

Hi, I cannot get my SelectedIndexChanged of my dropdownlist to fire. I have the following: <form id="form1" runat="server"> <div> <asp:GridView id="grdPoll" runat="server" AutoGenerateColumns="false"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server"...

Populating a thickbox via javascript or jQuery

I'm trying to get string data from a web service and populate a thickbox with this data. I feel like this should be the easiest part of the task but so far this is where I'm stuck. Here is the code in question... function AjaxRequestHandler(layerName) { PageMethods.AjaxRequestHandler(layerName, OnSucceeded); } function OnSucceed...