Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
all groups > asp.net datagrid control > may 2004

Filter by week: 1 2 3 4 5

dynamically hide/show delete
Posted by nikedog NO[at]SPAM msu.edu at 5/31/2004 4:41:01 PM
Is there a way to selectively hide/show the Delete command button on rows in the datagrid? I realize i can ignore the delete on rows where the is not allowed, but it would be cleaner to not show it. Any advice appreciated....more >>


Rotating a DataGrid
Posted by Steve Heckler at 5/29/2004 8:45:14 AM
Hi, All, I'm helping a client solve a tricky problem. Any suggestions on the below? Your help is greatly appreciated. I'm looking to build a dynamic datagrid. Dynamic by columns. In other words, the row result of a query will be the column headers. For example, a query result of invent...more >>

Unnecessary spacing between two images in the same column of datagrid
Posted by rb4am NO[at]SPAM yahoo.com at 5/29/2004 2:13:01 AM
Hi, I am placing two images in the same column of the datagrid as shown by the code given below. When I view this page in the browser, there is about 3 pixels of space between the images displayed (I am not expecting any spacing between these images). I want both the images to be displayed im...more >>

Problem creating custom header when datagrid AllowPaging=true
Posted by Atanas Marinov at 5/28/2004 2:56:28 PM
I have very strange problem with custom header. I create this in PreRender event, and if datagrid AllowPaging property = is false, result looks like this: CustomerID Sells Amount=20 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec=20 ALFKI 851 491.2 960 1086 1208 ...more >>

DataGrid Command Doesn't work
Posted by A.M at 5/28/2004 11:44:33 AM
Hi, I have this column in my DataGrid: <asp:ButtonColumn DataTextField="site_name" HeaderText="Name" CommandName="Select1"> <ItemStyle HorizontalAlign="Left" VerticalAlign="Top"></ItemStyle> </asp:ButtonColumn> This is how I bind the command to event handler: this.dg.ItemCommand += n...more >>

How do i refresh a datagrid from a popup window without re opening the page...
Posted by pkenty at 5/28/2004 12:11:09 AM
Hi, does any one know how to refresh a datagrid on one page from another page without having to load the whole page again Let me explain Ive got a page with 4 tabs on it with different datagrids in each tab..I have a add button on one page that open a new pop up window which allows the user to a...more >>

access control in header template
Posted by royguard NO[at]SPAM hotmail.com at 5/27/2004 7:06:14 PM
I got a label control which is dynamically created inside the headerTemplate of template column. And it is part of the datagrid. Please teach me how to read the content of that label control? I cannot use FindControl() function because it is created in runtime based on variable. And ever...more >>

How to reference hidden columns
Posted by David L at 5/27/2004 5:34:17 PM
I'm trying to reference a hidden key column in my datagrid control without success. I've set the columns up at design time through the property builder, and I've set my key column's visible property to false. In my updatecommand event I need to reference the key value for the update but I can'...more >>



Datagrid questions
Posted by lloydmonteiro NO[at]SPAM rediffmail.com at 5/27/2004 10:45:12 AM
i got couple of dotNet questions pertaining to dataGrid, if you could help me out. 1) how do i store more than one key value in the DATAKEY element. So far from what i have seen it doesnot seem possible, this is to store composite primary keys? i have found out that i need to join the compos...more >>

Paging not working in a datagrid
Posted by J. Muenchbourg at 5/27/2004 9:47:04 AM
I'm trying to use paging in a datagrid, but I can't get past the "cannot compute Count for a data source that does not implement ICollection" application error, as it does not point to a line in the code. Does the same thing even when i change the AllowCustomPaging property to AllowPaging . Wo...more >>

Disable viewstate
Posted by David at 5/26/2004 6:56:04 PM
I set grid's EnableViewState to false, when do paging, datasource is retrieved from server and grid is databinded. However no data shows in the grid for next pages....more >>

Hidden columns in execution time
Posted by Wallace Santos at 5/26/2004 12:02:48 PM
Hi, I have one datagrid where the columns are mounted in execution time and use a column template where exists a link. One necessary to make that the second column of grid that is mounted in execution time become hidden. Someone help me? And excuse my english errs ...more >>

Displaying data on same row as paging buttons
Posted by Craig at 5/25/2004 5:45:51 PM
How do you display data on the same row as the paging buttons? ...more >>

When to unload Session obejects
Posted by jorge at 5/25/2004 5:14:00 PM
Hi all, When should I remove objects that I have put in my session. The consumer of the control does not know anything about the control. I HAVE to put this guys in the session. Also, I need to know if a Button.Click event has been fired BEFORE a TextBox.TextChanged event gets fired. Which...more >>

Multiple Rows - BoundColumn/TemplateColumn
Posted by pdaniel NO[at]SPAM commonwealth.com at 5/25/2004 3:04:36 PM
I have a datagrid that I need to display the data that is bound to it in 2 lines (see below) (line 1)Account 345345435 - Smith Brokerage (line 2)Buy IBM 12 @ 34.987 12/23/2004 I have tried placing a datagrid within the parent grid, I have tried placing <br> tags i...more >>

Responding to checkbox in datagrid
Posted by Paul at 5/25/2004 2:38:18 PM
I have a datagrid in which I am displaying a column as a checkbox. A snippet of the aspx code where I use a template column to do this is shown below. I am at a loss as to how to respond to the checkbox being clicked. Any help would be appreciated. TIA Paul <asp:datagrid id="...more >>

insert blank row between records
Posted by mark at 5/25/2004 11:33:53 AM
i need to insert a blank row between each row of data - is this possible ? thanks mark ...more >>

Programatically setting a HeaderTemplate HeaderText.
Posted by andyrich_1 NO[at]SPAM hotmail.com at 5/25/2004 8:32:15 AM
I am trying to set the header text of a datagrid at run time using the following code <asp:TemplateColumn HeaderText=""> <HeaderTemplate> <asp:HyperLink id="hlLink" runat="server"></asp:HyperLink>="<%sHeadingString%> </HeaderTemplate> This doesn't work. And I can't seem to get to the obj...more >>

Is it possible to set title property on data grid cells?
Posted by mortb at 5/24/2004 2:33:20 PM
I would like to do: <table> <tr> <td title="My tool tip from DB">Some text</td> <tr> </table> Do someone have example code that sets the title property on a datagrid cell? Preferably with the title text comming from the datasource. cheers, mortb ...more >>

datagrid help
Posted by Mike at 5/24/2004 2:30:39 PM
I need to allow the user to double click on a row within the grid and when that happens I need to get detailed information on that row and display this informatin below the grid on the same page. example: header1 header2 header3 ---------------------------...more >>

scrollable grid question
Posted by Mike at 5/24/2004 11:25:13 AM
I know how to get a grid scrollable, but my question, how can I keep the Column headers and only scroll the data? example: header1 header2 - keep this permananet ------------------------------ name1 address1 - make this scroll only ...more >>

Itemcommand event uses wrong comand
Posted by daisykorse NO[at]SPAM hotmail.com at 5/24/2004 12:50:40 AM
Hi All. I have a simple web application with a single webpage. it contains a single datagrid control which loads data via a Microsoft CRM proxy without any problems. It also contains the two default linkbutton colums for Edit and Delete. I have created the Item command event handler which h...more >>

Edit Command button on alternate items
Posted by Miguel Ramirez at 5/23/2004 1:54:12 PM
Hello All, Can I hide the edit command button on alternable items? or in other case on items with certain value on a column? Best regards, Miguel. ...more >>

newbie needs help with datagrid
Posted by Mike at 5/23/2004 8:34:41 AM
I'm converting a existing .asp application to ASP.NET using Vb.NET. In my current asp application I have javascript grid and its populated from the ASP code using <%=dataitem%> and that populates the rows in the grid. How can i use the same grid and populate it with ASP.NET? Can <%= dataitem%...more >>

I need CausesValidation on Paging
Posted by Mehdi at 5/23/2004 12:15:55 AM
Hi, Does anyone know how to set Causesvalidation =true; when paging. I need to call my custom validator. Thanks for the help in advance. Regards Mehdi ...more >>

ASP.Net DataGrid VS. DropDownLists
Posted by christrumbla NO[at]SPAM hotmail.com at 5/22/2004 9:49:00 PM
Hello All, Need some help here. I posted this in the framework newsgroup and noticed this group so I'm posting it here as well. Sorry for the redundancy and/or bad etiquette. I'm building an asp.net app that uses a datagrid. I have created a template column and added a dropdownlist to it. W...more >>

How to Simulate Click Event on DG LinkButton?
Posted by cluelis via .NET 247 at 5/22/2004 8:06:09 PM
How can I programmatically simulate a click event on a datagrid linkbutton? I change the text of a linkbutton in a datagrid, then need to do some processing as though the user had clicked the linkbutton with the new text. I thought I could do it like this: *** // get datagrid item (row) D...more >>

Class 'System.Web.UI.WebControls.DataGridItem' cannot be indexed
Posted by sharmamukta NO[at]SPAM yahoo.com at 5/22/2004 1:31:15 PM
I am very new to asp.net. Please help me in resolving the error: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name RENEW_EXIST. I get the above error with the following code in aspx page <asp:Label ID="lblRenewExist" Visible="False" Runat="server" Text='<%# Da...more >>

Mathematical formula used in dynamically rendered DataGrid
Posted by Louis-Vincent Guay at 5/21/2004 4:15:22 PM
Hi, I'm trying to find the ASP mathematical formula for the calculation of the width in a dynamically rendered DataGrid with a SQL statement. Is someone knows such a formula, I'll be glad to know. I'm thinking of something related on proportions, but I'm absolutly not sure. ...more >>

Display Datagrid group Subtotals
Posted by pv_kannan NO[at]SPAM yahoo.com at 5/21/2004 2:49:45 PM
Hello, I am trying to achieve something in this format in a datagrid... Apologize if the drawing is not very clear... Make Model Value ===== ===== ====== Toyota Tercel 16000 15500 --------------...more >>

hiding a Datagrid column
Posted by samuel Mesel at 5/21/2004 1:31:04 PM
I'm developing an ASP.NET application. I have a datagrid that has 7 columns. The first 3 columns contain buttons (Select, Edit, and Delete) The next 4 contain data (Table name, Change Description, Change Date, and Table ID). I need to have the Table ID of the user's selected table - I use it ...more >>

adding Cutom columns from a business collection object
Posted by Nabeel Moeen at 5/21/2004 12:11:57 PM
Hello all, I'm new to ASP.NET and the .NET framework. I've been trying to get the WebControls.DataGrid to work but havent been successful in acheiving the desired results. What i need to do is, set the DataSource for the grid to some business collection object (from my application framework). i...more >>

Footer data - more than one row (sumarizing)
Posted by Miguel Ramirez at 5/20/2004 7:06:59 PM
Hello All, How can I add two rows on a datagrid footer for totals. I am displaying month sales for each customer on a datagrid, but for footer totals I want to display totals for customer as well as for region. So far I can only add one row totals in footer. I was thinking maybe to do it wi...more >>

Get Class from Aspx-File
Posted by Daniel H at 5/20/2004 3:08:56 PM
Hi, Is it possible to get the "ClassType" from a Filename to a .aspx file? I would like to access a class from an another page, knowing the filepath to the aspx-file (or the .cs-file) As I belivie that is how ASP.NET works (reading the aspx file and its <@ Page > to find/create the class ) ...more >>

DropdownList in EditItemTemplate
Posted by randy at 5/20/2004 2:14:29 PM
I have a template column and a DropdownList in the EditTemplateItem area. I can't find a way to bind a datatable to it when EditItemIndex is set...HELP After the user clicks Update the following code should work... dim cbo as DropdownList cbo = ctype(e.Item.FindControl("Dropdown1"), Dropd...more >>

confirm before delete ?
Posted by mark at 5/20/2004 1:38:27 PM
how would i add a yes/no box for a delete button ? e.g. this is my code - If e.CommandSource.commandname = "Delete" Then mainid = e.Item.Cells(0).Text mi.Text = e.Item.Cells(0).Text Dim strConn As String = "server=********;uid=****************;pwd=*********;database=************" Dim conn As...more >>

Stored Procedures
Posted by Anthony M. Davis at 5/19/2004 5:57:13 PM
Hi all, I'm a little confused about how to obtain a result set from a stored procedure (stored in a Visual FoxPro 8.0 database) from an ASP.NET web page in order to populate a WebForms DataGrid control. I've been experimenting using the code below but the only output i can get is: return...more >>

Strange behavior of invisible controls
Posted by Peter Afonin at 5/19/2004 1:26:57 PM
Hello: I'm updating multiple rows in the datagrid, using the routine described in the article "Top Questions about the DataGrid Web Server Control": http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchtopquestionsaboutaspnetdatagridservercontrol.asp To d...more >>

Fully Editable Datagrid
Posted by Pawan Gupta at 5/19/2004 2:39:09 AM
Hi, I am fairly new to ASP.Net but the transition to .net world cudnt have been more easy .. I have enjoyed wurking in .Net till now. Well I have a requirement to make the datagrid fully editable. Is there any way to do so ??? I did google but they talk about writing you own custom cont...more >>

Why do my datagrids have scrollbars?
Posted by Greg at 5/18/2004 5:13:03 PM
I have this one particular aspx page that, whenever I put a datagrid on it, the datagrid has scroll bars. I know that if you put a datagrid inside a DIV tag, it will have the scrollbars, but that's not what I want. This page I'm talking about has no DIVS. If I create a new aspx page, placing a...more >>

How to set the size of a edit-column in a datagrid
Posted by Tomas at 5/18/2004 1:01:59 PM
Hi I'm trying to set the size of the textbox that appears when clicking the edit-button in a datagrid, but I'cant find out how to do it. // Tomas ...more >>

Datagrid: aligning a template column
Posted by d[ - - ]b at 5/18/2004 12:33:40 PM
Hi, Is it possible to align a template column? Tried align, textalign and itemstyle (but I think that one is for the whole grid?), and nothing works. It's a simple datagrid, but one field is a dollar ($) value, so I've had to do a TemplateColumn so that I could make it have the '$'-sign and t...more >>

Export to Excel
Posted by Ugo at 5/18/2004 12:17:46 PM
We are trying to export a datagrid to excel but we are using forms authentication and when we change the ContentType = "application/vnd.ms-excel". the page that is sent to excel is out login page instead of the datagrid. For some reason our authentication cookie must get deleted. Any ideas....more >>

wrapping text in a datagrid cell
Posted by roybrew NO[at]SPAM att.net at 5/18/2004 5:17:44 AM
I have a datagrid that I am having text wrapping problems with. And the wrapping problems only happen with text containing long urls. If I set the column width to a fixed width through the ItemStyle-Width property in the ASPX file, the text above and below the url honor that fixed setting. Al...more >>

Summing a column and displaying in the footer
Posted by William Gower at 5/17/2004 1:03:16 PM
I would like to sum a column in my dataset and have it displayed at the bottom of the datagrid in the footer. How do I do that? ...more >>

Checking a checkbox based upon a table field
Posted by William Gower at 5/17/2004 11:48:37 AM
I have a template column in my grid that displays a checkbox. I would like to have the box checked if a field in the table that the grid is based upon has a "C" in the field. How do I do that? <asp:TemplateColumn HeaderText="Close"> <ItemTemplate> <asp:CheckBox Runat...more >>

How to prevent a checkbox from showing up in a datagrid with no records?
Posted by burak.gunay NO[at]SPAM xpandcorp.com at 5/17/2004 9:26:03 AM
Hello, I have a datagrid made up of two columns, the first has a checkbox in it and the other holds a job id. <Columns> <asp:TemplateColumn HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:CheckBox ID="chkIncomplete" Run...more >>

Multi row header in Datagrid
Posted by William Gower at 5/16/2004 11:20:28 PM
I have two columns in my datagrid, Hours Bid and Hours Expense. I would like to have the word Hours span both columns and then just have the column headings Bid and Expense underneath. Is that possible and how do I do that? ...more >>

Trigger Button1_ServerClick event from a popup form...
Posted by rmorvay at 5/16/2004 10:51:43 AM
I allow users to click a datagrid row and it spawns another browser page to allow edits to the data in that row. Once they update the data, it is committed to the database and the form is closed. Once the edit page is closed, I need to trigger the search button click event in order to refresh ...more >>

DataGrid - if/else in edititemtemplate?
Posted by JW at 5/16/2004 12:44:09 AM
Greetings - I am working with a DataGrid, and am trying to set up a template column for a password field which is stored in a database. Basically, when the "EditCommand" is executed, for the EditItemTemplate, I would like to display a HyperLink if a password exists for this particular table r...more >>


DevelopmentNow Blog