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
all groups > asp.net datagrid control > september 2004

Filter by week: 1 2 3 4 5

Populating a datagrid control ...
Posted by Prime at 9/30/2004 12:19:22 PM
Hi All ... I'm writing a small shopping cart app (uni assignment) and need to list all the books that a user selects. I have created a "BookBasket" object that contains among other things an arraylist of the user selected books. The "book" object contains isbn,title price and quantity infor...more >>


Sessin in DataGrid's Inherted Class
Posted by Marcin Gorzynski at 9/30/2004 8:30:12 AM
Hi I am trying to develope custom grid gving pssibility to save its datasource to XML file, View State and Session Problem is with Session because when I do drag and drop this control into vsiual designer I see error that makes my control not visualize properly. "Error rendering the control. M...more >>

Adding a dynamic textbox control to a datagrid with Datatable datasource
Posted by james_crane NO[at]SPAM btinternet.com at 9/30/2004 3:32:46 AM
Hi, I have a datagrid, and I want to bind this to a datatable, and I would like to have textbox controls and one button control. The problem is the textbox controls - they don't render, at run time it just says 'System.Web.UI.WebControls.TableCell' Any help would be appreciated. TextBo...more >>

Headings in the DataGrid Web Control
Posted by Alan Lambert at 9/29/2004 2:39:02 PM
I am writing a web-based reporting tool and using a datagrid to display information returned from a database. I am displaying column headings from bound columns with no problems but I need to have a heading above some of these that spans severla columns e.g. --------- OverAll Heading -----...more >>

Context Menu on datagrid.
Posted by Luis Esteban Valencia at 9/29/2004 11:54:21 AM
I need to make a right click menu on a datagrid, because each row of the datagrid has many options. Its very easy to use button columns but its not beatiful for the user because it would be like 8 buttons. so the best way I think is to make a contextual menu with 8 different options for each row....more >>

Is there a way to convert a sqldatareader to a dataview?
Posted by SiR_RuNcibLe_sPooN at 9/29/2004 11:23:01 AM
The sqldatareader is very fast but the dataview is very versatile. I need the features of the dataview and the speed of the datareader. ...more >>

Blank Text values - just wondering about this
Posted by postings NO[at]SPAM alexshirley.com at 9/28/2004 9:15:47 AM
Hi I'm just wondering why the following behavour is happens: If I try to get a text value from a datagrid (i.e. e.Item.Cells(x).Text), and that value is blank, I will get " " instead of a blank value. I assume this is behaviour by design? But I wonder why this is the case? I'm just ...more >>

onedit method
Posted by John H at 9/27/2004 2:59:50 PM
I have a datagrid that is bound to a database table. One field in the table is gender. When my datagrid first renders the Gender column shows "Male" or "Female". When I click Edit the Gender column displays 2 radio buttons so you can choose male or female. The thing is, I want to ensure tha...more >>



Changing Datagrid columns at runtime
Posted by Georg Scholz at 9/27/2004 11:54:14 AM
Dear all, I'm writing an ASP.NET application, which allows flexible editing of tables stored in an oracle database. Therefore, it is necessary to create all the bound columns at RUNTIME. So far, I'm already able to create bound columns and also to create an "Edit" Button column. The p...more >>

Problem with dataKeyField
Posted by Flare at 9/26/2004 7:52:47 PM
Hi Im having a problem with the DataKeyField and a array of a custom class. I have eg. this class class employee { public int ID { get / set } public String Name { get / set } } I can do this Employee emp[] = FACTORY.GetEmployees(); datagrid1.DataSource = emp; // ...more >>

Datagrid batch update
Posted by Applevalley01 at 9/25/2004 9:37:02 PM
I have created an excel like grid where the grid defaults to edit mode when it is renderered. But I would like a way to perform a batch update since I am dealing with 10000 rows in the grid. I do not want to make a roundtrip to the database for each row that was modified. I would appreciate it...more >>

Typed DatSet as a datasource to a Datagrid
Posted by BJM at 9/25/2004 8:04:05 PM
Hi, I am having a problem adding rows to a typed dataset and using the typed dateset as a data source to bind to a DataGrid. I receive the The IListSource does not contain any data sources. Error message I'm developing an app in asp.net using VB to allow a user to insert rows to a Datag...more >>

Column won't resize in datagrid
Posted by VB Programmer at 9/25/2004 5:41:23 PM
I cannot get my first 2 columns to adhear to my width settings. Any ideas? The datagrid is defined as: <asp:DataGrid id="dgLog" runat="server" Width="990px" Height="96px" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" Font-Names="Verdana" ...more >>

dropdown in a datagrid
Posted by GaryB at 9/25/2004 3:07:28 PM
I can put a dropdown in a grid column, databind it, and it will work but how can I get the itemchanged event so that I can do something with it? thanks, G ...more >>

Datagrid doesnt populate :(
Posted by Lasse Edsvik at 9/23/2004 3:38:35 PM
Hello Im trying to do a simple page with data from my local sql server, and page just shows up blank...... I created a stored procedure with SELECT * FROM Employees...... returns 9 rows in QA whats wrong? using System; using System.Configuration; using System.Data; using System...more >>

drag drop columns- datagrid
Posted by sri_san NO[at]SPAM mailcity.com at 9/23/2004 10:46:24 AM
Hello Group, I am working on making a datagrid able to move around the columns(drap, drop with mouse) and align it according to the user. Not quite sure where to start from. Any pointers would be great!! Thanks, Sam....more >>

Editable datagrid with drop downs and check boxes - sample code?
Posted by leah NO[at]SPAM kaplooey.com at 9/23/2004 9:34:27 AM
Hi. I'm looking for sample code for an EDITABLE grid with checkboxes, that, when in editing mode, displays a drop down box in the desired field(s). I have found editable grid samples for WebMatrix, and drop down samples for VS, but not a combination of both - in either format. Any ideas? Or e...more >>

boolean BoundColumn
Posted by Serge Lucas via .NET 247 at 9/23/2004 9:03:01 AM
Hello, I have bound a BoundColumn to a DataGrid, which is linked to a collection whose 1rst element is a bool. The DataGrid then displays 'true' or 'false', whereas I would like to display 'Y' or 'N' in it. Is there a mean to avoid using a Dataset for my DataGrid ? Thanks ! ----------...more >>

Dynamically adding a row into an gridview
Posted by Henk at 9/22/2004 8:18:36 PM
Hi All, I want to dynamically add a row in my gridview. I want to have a row beneath my headerrow with dropdowns in it, which I can use to filter on that column. I thought the GridView.RowCreated event would be my friend, by checking there if I would have an headerrow and then insert a new Gri...more >>

How to get selected cell value?
Posted by Lupina at 9/22/2004 3:00:34 PM
Hi I am trying to get value of certain cell, after I selected it (in datagrid). private void UsersDataGrid_SelectedIndexChanged(object sender, System.EventArgs e) { LabelInfo.Text = UsersDataGrid.SelectedItem.Cells[1].Text; }but LabelInfo is still empty . Why? ...more >>

Repeater paging problem
Posted by Viktor Popov at 9/22/2004 11:28:56 AM
Hi, I'm trying to do the following but I can't understand what's wrong. Could you help me here! I do paging with a Repeater like this: DataSet ds = new DataSet(); dad.Fill(ds, "MyOffers"); if(ds.Tables[0].Rows.Count==0) Delete.Enabled=false; PagedDataSource objPds = new PagedDataS...more >>

How to solve this? Random record in dataset or AdRotator
Posted by Miguel Dias Moura at 9/22/2004 7:41:12 AM
Hello, I need to display a random image in an ASP.Net/VB web page. I created a dataset which connects to an access database. So I got 2 fields: - Link where the image is placed. - Link to go when the image is clicked. Well, I placed an image in the page using this line: <img src='images...more >>

Datagrid CssClass being overridden by TD style
Posted by Laurence Neville at 9/22/2004 4:26:56 AM
Since I added a style for TD elements to my style sheet I have been unable to control the look of datagrids using the CssClass properties. Maybe there is no way round it, but I really need to keep the TD style in place to control other elements on the page. Is there a way around this? He...more >>

Datagrid/Range Validator Error - Help Pls
Posted by VB Programmer at 9/21/2004 7:04:57 PM
I am encountering a problem with my range validator in my datagrid. I have the following column in my datagrid: <ItemTemplate> <asp:TextBox id=txtValue runat="server" Font-Size="XX-Small" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Results") %>'> </asp:TextBox> <asp:Require...more >>

Master/Detail in one grid
Posted by Jeppe Dige Jespersen at 9/20/2004 11:13:14 PM
I need master info in several columns in _one_ row for each record. Below each "master" record, I need a number of detail rows. Like this: -------------------------------------- | Order01 | Order Date | Order Total | -------------------------------------- | Product info, orderItemA ...more >>

Using labels in the HeaderTemplate of a datagrid or datalist
Posted by ree32 NO[at]SPAM hotmail.com at 9/20/2004 5:53:47 PM
when I try to access this label to place a text in it in the code. I get this error - Object reference not set to an instance of an object. I assume this because the label is within the datalist I can't get a control of it. Is there anyway around this?...more >>

Can I set HeaderText on the fly?
Posted by VB Programmer at 9/20/2004 12:47:56 PM
Here's the columns in my dg: <Columns> <asp:BoundColumn DataField="Name" HeaderText="Area Manager"> <HeaderStyle Width="200px"></HeaderStyle> </asp:BoundColumn> <asp:BoundColumn DataField="Date1" HeaderText="<%# SetC...more >>

difference between these 2?
Posted by QPRJAY NO[at]SPAM gmail.com at 9/19/2004 3:58:13 PM
In some examples I am looking through they are speaking of datagrids and datalists (this is not the question :) For the datalist a column is populated using <%# Databinder.Eval(container.Dataitem, "some column") %> For the datagrid... <asp:Boundcolumn Datafield="some column" /> Is there an...more >>

Referincing datagrid with hidden and template column
Posted by hansiman at 9/17/2004 6:58:48 PM
I have a real hard time figuring out how to handle/reference submissions in the datagrid OnUpdateCommand. I've been through quite a few tutorials.... The datagrid columns <Columns> <asp:BoundColumn Visible="False" DataField="EmployeeID" HeaderText="EmployeeID"></asp:BoundColumn> ...more >>

attributes to ListItemType.Header
Posted by hansiman at 9/17/2004 4:46:10 PM
I want to add tooltexttips to a datagrids column headers. The code below handles BoundColumn but not TemplateColumn - and I can't figure out how to have it handle both. ' add tooltip text to selected header column cells Private Sub dg_ItemCreated( _ ByVal sender As Object, ...more >>

Getting back to grid list
Posted by Chip at 9/17/2004 12:13:29 PM
I have a grid which displays book titles. When a title is clicked, the book details is displayed. The user is then able to traverse the list by hitting Next/Prev buttons. I'm a bit stuck on the best way to get back to the original list. I can rerun the query, but I would need to get the user back...more >>

Easy way to clear the DataGrid
Posted by Janaka at 9/17/2004 11:50:45 AM
Is there a function to clear the Items out of the DataGrid or DataList? In my page I want the user to be able to do different searches and before rebinding the DataGrid, specify how many rows to display. Currently I am hiding the grid by specifying Visible = false. However this still persit...more >>

Show/Hide Textbox Conditionally -- Even if Postback Occurs
Posted by abaird NO[at]SPAM ucsd.edu at 9/17/2004 9:26:58 AM
I have a datagrid control that contains several columns of data (all bound columns) and a TextBox in the last column (in an ItemTemplate). If the text value of the second column in the datagrid is equal to "EquiTrac" (without the quotes), I don't want to display the TextBox in the last column. ...more >>

Autofill datagrid columns
Posted by Kivanç Karaca at 9/17/2004 12:05:42 AM
Hi All ! I want to create a datagrid with autofill function. It should work like that: The user will enter data for the first row and the remaining rows for that column will be filled with the same data automatically. Do you people believe that is it possible? Thanks... Kivanc ...more >>

trying to bind a typed dataset to a datagrid
Posted by bill yeager at 9/16/2004 3:25:09 PM
I can't bind a typed dataset to a datagrid. I've tried all kinds of things, but it just won't bind. I know I'm missing something! Weird thing is, I've done this many, many times before with no problem! Here is my xml schema for the typed dataset: <code> <?xml version="1.0" encoding="utf-8...more >>

Datagrid and clientside callback events
Posted by nospam NO[at]SPAM mailinator.com at 9/16/2004 3:49:13 AM
Hi All, I've been looking at clientside callbacks as a way to update parts of a page without a postback. Is there a way of rebinding a datagrid on the client. The scenario would be something like this: A work queue is displayed on a page using a datagrid Items are added to the underlyin...more >>

Grouping RadioButtons in a DataGrid
Posted by Sheikh Nabeel Moeen at 9/16/2004 1:25:35 AM
Hello, I have a TemplateColumn as the first column in my datagrid to display radiobuttons for selection of rows. The problem is, when the table (dataGrid) is generated all the Radiobuttons have autogenerated names so that they dont belong to the same group and more than one are selectable. How...more >>

Combine NumericPages NextPrev
Posted by Frederik at 9/15/2004 10:31:18 AM
Hi all, Is it possible to combine both PagerStyle-Modes "NumericPages" and "NextPrev"? Thanks for your time, Frederik ...more >>

Strangely hard
Posted by Support at 9/13/2004 4:44:29 PM
Hello: In asp.net, I want to select a row on a databound datagrid. I know the row's index so I only want to higlight that particular row. something like datagrid1.selectedrow=12 or something like that Thanks Terry ...more >>

ViewState Does not Persist with Named DataGrid Item
Posted by Trevor Benedict R at 9/13/2004 4:21:30 AM
Hi, I have a DataGrid that is databound. In the Item Created event, one of my developers has set the ID Property to a name. On the client side, there is code to refer to the TR tag so as to format and print the data in the datagrid. While the ID is set in the ItemCreated event, the postback eve...more >>

Live Meter Data on the Web - Advice please
Posted by BCM at 9/12/2004 10:56:51 AM
I've been asked to display some meter data on the web and I need preliminary advice. We have several hundred meters on site, with a system that writes out xml files at 10 second intervals containing their data. (These files are overwritten every 10 seconds, not appended to.) First, I nee...more >>

Help with Hyperlink Column!
Posted by Jack Black at 9/10/2004 12:16:06 PM
Hi, all! I'm trying to build a hyperlink column who textField is one column in the query, but whose URL needs to dyunamically contain the data from another. For example, I want to display a book title (column = "Title"), but the URL needs to be: myPage.aspx?book=ISBN (where ISBN is a ...more >>

Need Help Please!
Posted by daniel_st.pierre NO[at]SPAM fpl.com at 9/9/2004 12:30:13 PM
ok here's the code and bellow i explain the problem // Create new data view DataView BottomDataView = new DataView(); // Give dataview the datatable BottomDataView.Table = myBottomDT; DataTable myNewBottomDT = new DataTable("myNewBottomDT1"); DataRow myNewBottomDR; #...more >>

Can't get value from datagrid when generating columns on the server side
Posted by postings NO[at]SPAM alexshirley.com at 9/8/2004 5:21:15 AM
Hi I have a problem with a datagrid, I need to get a value from one of the columns from when I hit a hyperlink column. The hyperlink column is the first column, and the second column is the value (which is in fact "ContactID"). The event that fires when I click on the hyperlink column defin...more >>

how about something simple but eludes me ->onselect ->post
Posted by Terry at 9/7/2004 7:33:41 PM
Hello: I have a bound datagrid and I want to do something simple but I canot figure it out: When I click on a row, I want to capture a cell value in the row (simple) but I also want to post the form, ie, submit the form .... apparently the datagrid does not support postings like the button a...more >>

Changing an image in a datagrid column in the ItemDataBound event
Posted by MW at 9/7/2004 12:35:49 PM
Hi, I have a datagrid that is bound to a datatable, I'm using TemplateColumns. The heading of two columns of the datagrid fire the ItemCommand event in which I sort the datatable then rebind to the datagrid. One column is an image (which the imageurl is set in the first binding of the...more >>

Bind strongly typed dictionary class to datagrid?
Posted by dotnw NO[at]SPAM hotmail.com at 9/7/2004 10:56:47 AM
Say I create my own strongly typed dictionary class. How do you bind, for instance, the key column of this class to a datagrid? I've tried a few different ways, but each time I get this error: A field or property with the name 'keycol' was not found on the selected datasource. I unders...more >>

drop down list always a vertical display
Posted by leah NO[at]SPAM kaplooey.com at 9/7/2004 6:35:18 AM
Okay. I followed the steps from a MS KB article (306227, i think) about how to create a frop down box in a data grid, and bind to data. However, the contents always displays vertically, like: d a t a Instead of data Any ideas? I can't seem to find a property to set. Thanks fo...more >>

Cells numbers problem on OnItemCommand
Posted by ree32 NO[at]SPAM hotmail.com at 9/6/2004 8:28:08 PM
I am using a a datagrid to display results from a dataset. I have a button on each row of the grid, so when the user clicks on it, it displays more information from the the dataset which is not initially shown in the datagrid. But I have a problem as I don't know how to access the "hidden" c...more >>

datagrid footer question
Posted by mark at 9/6/2004 7:57:53 AM
im keeping running totals of certain columns in a datagrid, id like to put these totals in the footer - how do i do this ? or how can i put a label into the footer ? (im displaying results using labels instead at the moment) eg Label5.Text = "Column 1 Total:- " & mordraw & " (Ratio " & Format...more >>


DevelopmentNow Blog