Groups | Blog | Home


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 > april 2004

Filter by week: 1 2 3 4 5

DataGrid with a menu...
Posted by spai NO[at]SPAM immunetolerance.org at 4/30/2004 3:19:07 PM
Hello there, I need to create a Data Grid for an ASP.Net Page which would have all these feature. When the user sets focus on one of the colums the column of the Data Grid it should display a list of menu options to the right hand side of the column which would have various ...more >>


Moving Rows in a datagrid.
Posted by Thomasa Gregg at 4/30/2004 12:42:01 PM
Does anyone know of a good example that shows me how I can move rows in a datagrid? For example Click and Drag row 5 and drop it on row 2 to insert it above row 2. Thanks ...more >>

Use Parent Column in Child?
Posted by Allen Davis at 4/30/2004 11:41:04 AM
Is there a way to retrieve a column from the parent table of a relationship and display it in the child data control? In my case, I'd like to show a column from the parent DataList showing seating capacity in the child DataList's ItemTemplate. Is this possible?...more >>

Show DataGrid Item Count?
Posted by Allen Davis at 4/30/2004 6:41:02 AM
I have a DataGrid in an ASP.NET page that is the third of three nested controls (2 DataLists and the DataGrid). It uses relations in the DataSet and a DataView RowFilter to determine what data to bind to and display. What I'd like to do is show a count of items in the DataGrid header but I can't fin...more >>

datalist please help soon
Posted by mahsa at 4/30/2004 2:21:03 AM
H data I'm binding to the DataList is information about products in my product database. Perhaps passed in the QueryString to this page is a ProductID. I might want to make the item in the DataList that has the corresponding ProductID selected. In a similar vein, perhaps I want to have newest produ...more >>

Setting Focus in DataGrid - Solution
Posted by john NO[at]SPAM haasbeek.com at 4/29/2004 10:48:17 PM
I googled for a solution to this and didn't find a clear one, so I thought I'd pass along what I ended up with. In the PreRender event of the DataGrid, I execute the following code: private void myGrid_PreRender(object sender, System.EventArgs e) { foreach (DataGridItem item in myGrid.Ite...more >>

Click on sort link on a datagrid opens new window
Posted by Raymond Lewallen at 4/29/2004 12:44:32 PM
I have a modal dialog displaying a datagrid control. Click on the column header to sort the datagrid opens a new window with the following in the location: javascript:__doPostBack('dgDataGrid$_ctl1$_ctl1','') instead of actually posting back to the modal dialog and sorting the datagrid. I...more >>

DropDownList SelectedIndex problem in C# (from working VB.NET)
Posted by rishadq NO[at]SPAM yahoo.com at 4/29/2004 10:59:49 AM
Hello All, I've been diligently going through the examples in Scott Mitchell's "ASP Data Web Controls" book (I would recommend this work -- cleared up a lot of questions for me). All of the examples are in VB.NET and though I've been able to convert pretty much all of the examples so far int...more >>



Getting to the data in a cell
Posted by Tim at 4/29/2004 10:46:00 AM
Hi, anyone know how I can get to the cell: "<td><%# DataBinder.Eval(Container.DataItem, "USL")%></td>" in the below code to change it? Please let me know if I should design it different. This is how deep I have to go in the DataGrid (highlighted in blue)... Quote: <Columns> <asp:Templ...more >>

Controls Hierarchy in DataGrid
Posted by john NO[at]SPAM haasbeek.com at 4/29/2004 10:12:03 AM
It appears that there are only 2 ways to get to a particular control in a DataGrid - either use the FindControl method or try to work your way through the (apparently undocumented) hierarchy of controls (dgItem.Controls[0].Controls[0].Controls[2]...). Using FindControl is OK except that to mak...more >>

DataGrid ItemStyle is a textbox and doesn't update the datagrid datasource
Posted by mschoup NO[at]SPAM excite.com at 4/29/2004 8:00:27 AM
I have a datagrid with two columns, the first a normal bound column, the second is a template column created from a bound column. For the ItemTemplate of the Template Column, I removed the label and replaced it with a textbox. Displaying the data from the datasource is not a problem, however w...more >>

Using LEFT function on boundcolumn
Posted by Aaron at 4/29/2004 7:16:49 AM
I have a boundcolumn in a datagrid using the following code: <asp:BoundColumn DataField="Activity_Notes" ItemStyle-Width="25%" HeaderText="Notes"></asp:BoundColumn> What I would like to do is perform a left function to display only the first 100 characters of the string found in "Activity_No...more >>

RadioButtonList In A DataGrid Cell - Can I find the selected button without editing the cell?
Posted by Empire City at 4/29/2004 4:22:50 AM
I have an ASP.NET form with a DataGrid and Button. I want to put a RadioButtonList in a DataGrid cell. I bind it to an ArrayList which has a ListItem in the cell. The display part works fine. I then check some boxes and hit the submit button. I can't seem to get the value that is selected on th...more >>

Need to add aditional column to Datagrid
Posted by Javier Villegas at 4/28/2004 2:10:23 PM
Hi, I am new with VB.Net and I need some help I am building an ASP.Net application in where the user enter a letter and then press a button that make a SELECT in a SQL database. The results are displayed in a Datagrid This application is for look up phone numbers I made the SELECT from...more >>

How to specify ROW properties in a datagrid
Posted by Jørn A at 4/28/2004 12:40:43 PM
Customizing a datagrid is as you probably all know done by defining the different columns. But is it possible to specify properties for the ROWS in the datagrid? I would like to make a hyperlink that spans each complete row in the grid. I would also like to define a CSSClass for the TR HTML-tags...more >>

Changing ImageURL of Image Button which is added in template column of datagrid
Posted by raghunath at 4/28/2004 12:33:27 PM
hello, I have a template column in my datagrid. To the header of template colum, i have added imagebutton. On click of the imagebutton , i want to change imageurl of image button. thanks in advance, Raghunath. ...more >>

datagrid select button
Posted by mark at 4/28/2004 11:39:35 AM
not sure whats happening here - i basically cutnpasted the code from a page that this code works on but the select button is just not firing any events now code behind :- Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)...more >>

First Record in DataSet corrupted
Posted by Roger Twomey at 4/28/2004 8:36:27 AM
I have a web app that allows a user to upload an excel spread sheet and then view it on the web (okay it does more than that but this is the part with a problem). The spread sheet uploads correctly, it even displays well in the data grid. There is one problem however. The first record alway...more >>

Customizing exisiting DataGrid Functionality
Posted by Adnan Qamar at 4/28/2004 6:56:01 AM
H I am developing a generic data-grid for custom needs. Is it possible to inherit existing ASP.NET datagrid and overriding as well as introducing further functionality Thanx...more >>

DropDown and SelectIndexChanged
Posted by Paulo at 4/28/2004 3:56:04 AM
Hi. I have two template columns in a datagrid. Each of them as DropDownlist. I need to bind some data in the second dropdownlist when th selection changes in the first dropdown. How can I set for the first contro to invoke a method in the server side to update data shown in the secon one ...more >>

add TemplateColumn(dropdown) to DataGrid at runtime
Posted by Kilic at 4/27/2004 6:18:04 PM
Hi, I am having trouble adding a dropdown to DataGrid at runtime. I create all boundColumns and the TemplateColumn for the dropdown at runtime. The dropdown has a different datasource then the DataGrid. 1. If I try to bind the second datasource to the dropdown I get An unhandled exception ...more >>

datagrid question: template column
Posted by Sam at 4/27/2004 5:07:40 PM
how to capture button click event (created under template column) ? should i used javascript? could you give me sample program? and is it possible after datagrid rendering, we get specific value (ex: row(1).column(0))? tks, ...more >>

Determining row that caused an ItemCommand
Posted by William Gower at 4/27/2004 12:05:08 PM
I have an Edit button on a datagrid. When the edit button is clicked, how do i know which row is the one where the button was clicked? ...more >>

Datagrid disappearing on Edit, Update, or Cancel
Posted by bgledet at 4/26/2004 7:21:01 PM
I had an application developed on asp.net 1.0. I recently moved the application to 2003 server and asp.net 1.1. The application loads fine, but everytime you click the edit button the grid, the grid disappears. dg1.EditItemIndex = e.Item.ItemInde Dim ponum As Integer = CInt(txt...more >>

Multi-parameter query string in hyperlink column...
Posted by Steve Kallal at 4/26/2004 5:51:04 PM
I have found some postings on multi-parameter hyperlinks. But none of them involve calling a javascript function. I have almost got the NavigateUrl property to work, but not quite. Here is the DataGrid definition <asp:DataGrid id="grid" runat="server" Width="99%" AutogenerateColumns="false" Al...more >>

onMouseOver
Posted by paul.hale NO[at]SPAM safenames.co.uk at 4/26/2004 11:01:40 AM
Hi, I have a datagrid that has a particular cell that holds an HTML table that in turn holds 10 text boxes. I would like (if possible) for when the users mouse rolls over this particular cell for the cell to expand displaying the HTML table and the text boxes it contains. It would be kind o...more >>

Display Dynamic hyperlink in the Datagrid
Posted by Roopashree BR via .NET 247 at 4/26/2004 3:13:38 AM
I have a datagrid which is populated with the values from the database and has a column named Description. According to value of Description, the text of the Description is to be changed to hyperlink. eg. If its value is XX --- then display hyperlink for this value alone in the column Elseif its v...more >>

Enter key in datagrid
Posted by Stephen J. Shephard at 4/25/2004 2:47:08 PM
Hi there, I know this is probably a 101-type question, and I've dealt with it using client script blocks before, but I'm curious about what the best way to handle the enter key is.. (i.e., to handle it when it generates a postback). In my particularly frustrating situation, I have a master-det...more >>

Can grouping be done with datagrid
Posted by William Gower at 4/24/2004 7:00:19 PM
I have a column called customer in a grid of users. I would like to display the name of the customer in the first column only if the name customer changes. Is that possible with a datagrid and how would I go about doing that? ...more >>

Help Findcontrol not working with data grid and EditItemTemplate
Posted by SStory at 4/24/2004 9:31:28 AM
I have a data grid 6 columns wide. in the 6th column I have a itemtemplate with a text box txtComment and in the corresponding edititemtemplate I have txtEditComment In the updatecommand I try to use e.item.findcontrol("txtEditComment") to get it but it never returns a value I think it m...more >>

Type 'DataGridPageChangedEventArgs' is not defined
Posted by William Gower at 4/23/2004 4:39:49 PM
In my code-behind page I have this routine. What do I have to do for it to recognize DataGridPageChangedEventArgs? Sub PageIndexChanged(ByVal source As Object, ByVal e As DataGridPageChangedEventArgs) _ Handles DataGrid1.PageIndexChanged DataGrid1.CurrentPageIndex = e.NewPageIndex Bin...more >>

Please help me with this error in datagrid paging
Posted by William Gower at 4/23/2004 1:37:01 PM
AllowCustomPaging must be true and VirtualItemCount must be set for a DataGrid with ID DataGrid1 when AllowPaging is set to true and the selected datasource does not implement ICollection. I set AllowPaging = "True" and PageSize=10 ...more >>

DataGrid disappears on UpdateCommand
Posted by displacer at 4/23/2004 10:51:55 AM
Hi, I'm using a DataGrid with dynmically created colums. (AutoGenerateColumns=false) I call the DataGrid creation and data binding if !IsPostBack in Page_Load. By clicking on Update my DataGrid disappears. The strange this is: When I use AutoGenerateColumns=true (not using dynmically creat...more >>

Problem calling Fill() method
Posted by Mervin Williams at 4/23/2004 9:42:29 AM
I have several tables involved in my application, but the two in question here are the company and address tables. The company table has business_address_id and mailing_address_id columns, which are both foreign keys to the address table. So, the stored procedure to which my SelectCommand poi...more >>

Filtering data and adding headers within same datagrid
Posted by Tr at 4/22/2004 11:22:57 PM
Hello, Posted this over on the ADO.net group but it belongs here. I am working on a ASP page with a datagrid that has 5 columns that I bind to a datatable which is filled via the ReadXml parser. Once this data is there I need a way to: 1) Segregate each unique group of data that has t...more >>

Sorting link disappear when put control in the header
Posted by Laszlo Csabi at 4/22/2004 2:29:52 PM
HI guys, I have a datagrid with 5 coloums. What I want to achive is put a button or a checkbox into each header of the coloums and when fires an event then hide that coloumn, also want to make those coumns sortable. As soon as I put a control in the header I lost my sorting option. Has a...more >>

Databinding array of custom classes to DataGrid
Posted by Joe Rattz at 4/22/2004 2:01:09 PM
I can't seem to bind an array of custom classes to my DataGrid. I get the following error "A field or property with the name 'dcAbbreviation' was not found on the selected datasource: This seems like it should be simple as falling off a log, but I can't find it. I also can't seem to find any u...more >>

Help with simple datagrid paging and sorting issue
Posted by charliekunkel NO[at]SPAM hotmail.com at 4/22/2004 1:59:12 PM
Please help! I have a simple web app that displays some search fields, posts back to itself onclick of the search button, and shows the results in a datagrid. I have default paging turned on, and SortExpressions set for all the datagrid columns. Yet, any time OnPageIndexChanged or OnSortCom...more >>

Changing text of a label inside a control...
Posted by bredal Jensen at 4/22/2004 1:19:49 PM
Hello there, I need to change the text of a label inside a datagrid. The label is part of an <EditItemTemplate > Can anyone post code of how to do this? Many thanks ...more >>

Reset DataGrid
Posted by Tom McLaughlin at 4/22/2004 1:08:23 PM
I have a datagrid on a form that I populate with the following: DS.Clear() DA.Fill(DS,myTable) DataGrid1.DataSource = DS DataGrid1.Datamember = myTable That works fine but when I try to reload the same datagrid with a different DataSet the original data is still there. All that happens...more >>

questions about datagrid
Posted by Sam at 4/22/2004 1:22:09 AM
1. how to disable "show navigations button" by program? 2. how to set position/location (top and left corner) of datagrid by program? ...more >>

Column Header
Posted by Demetri at 4/21/2004 2:30:21 PM
I have a web form with a datagrid. The datagrid has 5 columns. In design mode each column has header text. I defined the header text, data source, etc in property builder. I have also verified my settings in html mode. Everything looks great. When I run the app one of the headers are not there...more >>

postback weirdness
Posted by Ian Oldbury at 4/21/2004 11:37:50 AM
i have a textbox within a grid and it postsback on textchanged event. i also have an image button on the page. however if the user changes the content of the textbox and presses return to action it, the textchanged event fires and then the pressing of return fires the clicking of the image b...more >>

Which cell was clicked
Posted by simon at 4/21/2004 11:30:30 AM
I would like to create a postBack when user click on the cell: In my dataGrid, I put the button column: <asp:buttoncolumn visible="false" commandname="Select"></asp:buttoncolumn> Then on ItemDataBound, I add : Private Sub dgdMedia_ItemDataBound(ByVal sender As Object, ByVal e As System.We...more >>

Make hyperlink appear in a datagrid cell
Posted by Lynn at 4/21/2004 11:11:03 AM
Hi I have a datagrid, on a form, which contains a custom column style that converts a data grid text field into a linklabel. The problem I am having is that the link doesn't appear until the cell is clicked. Is there a way to have the link appear when the datagrid is loaded Thanks Lynn...more >>

dropdown event SelectedIndexChange
Posted by Danny at 4/21/2004 10:11:25 AM
Hi. I have two template columns in a datagrid. Each of them as a DropDownlist. I need to bind some data in the second dropdownlist when the selection changes in the first dropdown. How can I set for the first control to invoke a method in the server side to update data shown in the second one? ...more >>

databinding after page_load
Posted by sub NO[at]SPAM pox.nl at 4/21/2004 1:43:21 AM
Hi, I'm working on a webpage which starts with a rather timeconsuming database transaction. (two different .mdb's from different MSAccess versions :-(). IN order to make things acceptable I want to use a progressbar. I use a webcontrol for that from Farside Web Progressbar. It works as follo...more >>

Select a row from a DataGrid1 by passing a QueryString variable
Posted by David Dimmer at 4/20/2004 1:39:53 PM
I can not seem to get the row index in my datagrid containing the string id I pass in. Any suggestions? I know once I know the row index I will use: DataGrid1.SelectedIndex = [rowID]; How do I find the rowID and mark it selected? -- Sincerely, David Dimmer _________FYiN______...more >>

Learning the datagrid using VS.net
Posted by rob NO[at]SPAM nywaterway.com at 4/20/2004 1:17:15 PM
I would like a good resource that demonstrates most of the datagrids abilities using Visual Studio.NET. It seems like most of the books and online information show examples of the datagrid strictly using script and text editors. Can someone direct me?...more >>

Editable Datagrid Dropdownlist error
Posted by anon at 4/20/2004 11:51:40 AM
Hi All, I have an editable datagrid which i created using the example on 4 guys from rolla http://www.4guysfromrolla.com/webtech/050801-1.2.shtml in this example the dataview is used as a source for the ddl in the edit mode, however is it possible to use just arrays, i tried having a funct...more >>


DevelopmentNow Blog