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 > february 2006

Filter by week: 1 2 3 4

Cells conditional formatting (i.e.Red for negative values)
Posted by Saverio Tedeschi at 2/28/2006 5:40:30 PM
Hi all gurus, I'd like to have a "Excel like" behaviour, like that of the subj. Is it possible? I guess not, since I've found no similar solution. However, trying in "DataBinding" or "PreRender" methods? Any clue much appreciated. Thanks in advance. ...more >>

Checkbox in Datagrid not trapping event
Posted by wolfman at 2/27/2006 2:10:34 PM
Here is the problem. I have worked with checkboxes in datagrids before with no problem. Check the box, it does a postback which adds it to a listbox and, when you have made all your selections, hit the save button and it all gets saved. That works fine for batch updates, but I need a grid wher...more >>

Custom Datagrid
Posted by Kb at 2/27/2006 11:27:19 AM
I have written custom data grid that has dataset stored in session as its data source. The grid is always in edit mode so at any time users can change the values in any grid rows. I have add row button on the grid and want to save the changes to grid if add button is pressed. I am trying fi...more >>

Formatting for display a datagrid with many columns
Posted by booksnore at 2/27/2006 8:01:21 AM
I have a spec for a datagrid that the client has provided that includes 40 columns that the client wants to be able to edit. What is the best way of formatting very long tables for display? I saw a note posted to say use a dropdownlist to allow users to select additional fields for view if the ...more >>

filling the grid
Posted by dirk van waes at 2/26/2006 5:16:25 PM
Hello, I fill an arraylist (ALstudents) with data from a dataset Therefor, I first made a structure : Public Structure lldata Dim NameForname As String Dim points As String Dim llremark As String ...more >>

Loading all files in a folder to a grid
Posted by Moiz at 2/25/2006 12:00:00 AM
Is there an easy way to create a list of all files in a folder (and subfolders) using asp.net? example: Folder: pdf\sub1 doc1 doc2 Folder: pdf\sub2 doc3 doc4 Thank you Moiz ...more >>

datagrid in asp.net
Posted by Jason at 2/24/2006 4:18:30 PM
we have a database's table which looks like this: id,GRP_Name,Parent_ID 01,name0001, 02,name0002,01 03,name0003, 04,name0004, 05,name0005,03 now, when i using datagrid to display this table on an asp.net page, how can I make it looks like this? any simple query can do this? id,GRP_Name,...more >>

DetailsView Update Issues
Posted by Steven Livingstone at 2/24/2006 4:11:36 PM
For once i decided to use the much hyped wizards that come with Net 2 rather than the programmatic way I have always done. What a nightmare - and some google, i see i am not the only one. A whole day for something i could write in a fraction of the time!! I have an object i am binding to wit...more >>



How do I find Datagrid in a Page
Posted by Kb at 2/24/2006 3:15:19 PM
I am completely lost. I have page that has usercontrol that has bunch of datagrids. How do I iterate through the controls in usercontrol to find datagrid? I did For Each my_Controls In Me.Controls If TypeOf my_Controls Is DataGrid Then CType(my_Controls, DataGr...more >>

editing / updating dynamic dgrid
Posted by dirk van waes at 2/23/2006 4:52:48 PM
Hello, I have a dynamic datagrid , made and filled by VB code. No problem here! But when I try to update my db via this datagrid, Im in deep trouble! The problem is that when I do a databind on every postback, I loose the updated values. When I don't do a databind of the grid on page_load (on...more >>

Datagrid & column sizing
Posted by dew at 2/23/2006 4:05:15 PM
Is there a way to control the size of columns when you are using AutoGenerated columns? I have a grid that spans the width of a table, and rather than spreading out the columns evenly, it seems like the last column, which only has numeric data, 3-4 characters at the most, is spread out very ...more >>

Trouble with DataList
Posted by Robert Sheppard at 2/23/2006 8:39:08 AM
I have multiple DataList controls on the same page and I want to bind each of them to different datasets. Is this possible? I am currently using the following syntax to bind my first dataset. private void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { ...more >>

passing parameter to SqlDataAdapter
Posted by TJ at 2/23/2006 7:50:43 AM
Hi, I am a newbee, I want to know few things about Datagrid. 1. I used the designer to create a Datagrid with SELECT, INSERT,DELETE and UPDATE commands. Now I want to retrieve data depending on the "current_id" value on the page. So that is a parameter to the SELECT Statement. The problem is ...more >>

Syntax to loop through the DataList
Posted by jmhmaine at 2/23/2006 3:48:59 AM
My Code: HTML for Panel 1 <asp:DataList ID="dlItems" Runat=server DataKeyField="Prod_PK" > <ItemTemplate> <table class="ItemTable" cellSpacing="0" cellPadding="1" width="400" border="0"> <tr> <td width="300" class="ProdName"> <%# Container.DataItem("Prod_Name") ...more >>

SQL injection?
Posted by John at 2/22/2006 5:24:51 PM
Is it possible for SQL injection to be used through the Edit feature on an asp.net 2005 data grid view control? ...more >>

CSS styles and item colours
Posted by Paul Cheetham at 2/21/2006 6:58:41 PM
Hi, I have a datagrid, where I have used CSS classes for the item style and alternating item style. The grid draws great when I load the page, but I have problems when I want to select a line by clicking on it. When a row is clicked on, I set the backcolor of that row in order to show i...more >>

ASP.NET 2.0 and ObjectDataBinding
Posted by dm1608 at 2/21/2006 12:58:32 PM
I'm doing an ASP.NET 2.0 project where I have a BAL and DAL layer. I'm passing a DataSet from the DAL to the BAL. The BAL is passing generics back to the presentation. All works fine, however, I noticed a problem with my code that does something like this in the BAL: List<JobSummary> j...more >>

GridView SelectedDataKey paging problem
Posted by otto at 2/21/2006 12:47:36 PM
Hi, I have a GridView where I've implemented paging along with a Button that uses the CommandName "Select". When I render the page initially, I click the button and handle the SelectedIndexChanged event and get the SelectedDataKey values as expected. When I change the page on the grid, I ...more >>

GridView - Display two columns as one
Posted by Felix_WafyTech at 2/21/2006 12:32:22 AM
Hi, I would like to display two columns as one. I have two hyperlink columns that display an image and perform two different actions based on the Id field in the row. I would like to display both these columns as a single column. Once that's accomplished I would like to hide or show either ...more >>

columnwidth
Posted by dirk van waes at 2/19/2006 12:25:27 PM
Hi, I'm pretty new in asp.net, so my questions may be too simple for this = newsgroup, but I don't find answers! I use asp.net 1.1 I created programmatically a datagrid with 4 column (3 boundcolumns and = 1 EditCommandColumn) No problems so far! But... Now I want the colums to have a fixed wi...more >>

Form Query and GridView for ASP.NET 2.0
Posted by dm1608 at 2/18/2006 3:03:37 PM
Hi all -- I'm rapidly learning ASP.NET 2.0 (never really did much .NET before... mainly an ASP and PHP guy until now) and seem to be having some technical challenges that I'm hoping someone can help me with. I've created an n-tier application that consists of a Business Access Lay and a ...more >>

GridView ASP.NET 2.0 Question
Posted by dm1608 at 2/17/2006 4:46:11 PM
Hi, I'm using a GridView and an ObjectDataSource to display data. How can I display a "No records found" message if there are no query results? Currently, I'm getting a blank page since the GridView has nothing to display. Thanks ...more >>

referencing child gridview values
Posted by Trevor Bezotte at 2/17/2006 2:57:25 PM
Hi, I have a Gridview (Gridview2) which changes its content (row details from Gridview1) when a row is selected in Gridview1. I want to retrieve the values (specifically the values foo_id and blee_id) from Gridview2 in the GridView1_SelectedIndexChanged event. Is this possible? How do I do...more >>

how ot change value in a datagrid
Posted by yoshitha at 2/16/2006 6:59:50 PM
hi in a table for some of the rows for one of the fields lets say field1 i've data and for some of the rows in dont have any data. so while binding the datasource to the datagrid, i want to chage this field like assigned if tha tfield contains value other wise not assigned text wiil be d...more >>

Textbox Problem in DataGrid1_UpdateCommand
Posted by Tom Grinnert at 2/15/2006 12:00:00 AM
Hello ! Im using a simple Datagrid in a C# VS 2002 Webapplication. If I change the String in "Item.Cells[1].Controls[0] " the following code outputs after click on update: DataGrid being UPDATED - DataGrid1 : Item - 0 > OldString But the String I write to Grid was "NewString". Why d...more >>

What is the structure hierarchy here?
Posted by Doru Roman at 2/14/2006 7:55:37 AM
Hi, To update the changes in the grid I use the structure taken from the Help examples: private void dgCompany_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { TextBox CompanyBox = (TextBox)e.Item.Cells[2].Controls[0]; I try to get the hierarchy...more >>

Data Binding - ASP 2.0
Posted by dm1608 at 2/13/2006 4:17:31 PM
I'm binding a column to a datagrid and would like to convert the column to uppercase. I notice that if I edit the GridView column, I can add formatting such as {0:d} and {0:c} to the data item. How can I convert this item to Uppercase? I suppose I could do it via SQL, but I want to know...more >>

DataGrid & Checkbox Template Columns
Posted by J at 2/13/2006 6:07:42 AM
Hi, I've got a simple datagrid that is populated by an adapter from SQL. I have two template columns - one with a checkbox and one with a textbox. I am allowing users to indicate which rows to remove from the grid by checking the boxes - the boxes don't autopostback, i want to remove all sele...more >>

Problem Extending DataGridColumn
Posted by Chris Arnold at 2/12/2006 2:00:16 PM
Hi All, OK, here's the situation ... I have an ASPX page (.Net v1.1) that contains a DataGrid control. This DataGrid is bound to a DataSource if not PostBack. Each row in the DataGrid corresponds to 1 row in the first table in the Dataset bound to the DataGrid. Pretty simple so far! N...more >>

DataFormatString of GridView control isn't working
Posted by Jaime Stuardo at 2/9/2006 5:47:48 AM
Hi all... I have a webform with a GridView on it. One of the columns is of decimal type with DataFormatString = {0:###,###.00}. When I run the page, format isn't applied, showing the number, for example, as "2108,9100". This format would be displayed if I execute number.ToString( ), that i...more >>

about data grid
Posted by yoshitha at 2/9/2006 12:00:00 AM
hi all i' m displaying data in datagrid., and i'm using edit command column. when i click on edit button then it is showing text box in the items where ididnt set read only, what i want to know is is it possible to reduce the size of the text boxex whcihc are appearing when we click e...more >>

EditCommand - Assign a field a checkbox/listbox instead of default textbox
Posted by Kevin Humphreys at 2/8/2006 4:07:10 PM
Hi, When I fill an unbound datagrid I want to assign a field (that returns a 1 or 0 value) from a Stored Procedure a checkbox instead of the default textbox on the EditCommand event. How can this be done? The code I have to fill the data grid is below da.Fill(ds, "Table1") ...more >>

editbutton
Posted by dirk van waes at 2/8/2006 3:52:37 PM
Hi, I'm total new to asp.net. I use asp.net 1.1 as databasesource I use:=20 selleerlingen.CommandText =3D "Select naamvoornaam, " & = CType(Session("periode2"), String) & ", " & CType(Session("periode2"), = String) & "opmerking from punten where leraarnummer =3D" & = CType(Session("leraarnr")...more >>

Wrapping a grid?
Posted by dew at 2/7/2006 5:08:06 PM
Is there a way to "wrap" a grid? I have about 50 bound, autogenerated columns and of course don't want it to scroll across the page, but I don't want to have to make them templated columns and have to enter 50 label controls either. Thanks for your help. ...more >>

add column to data grid
Posted by netnet at 2/7/2006 3:06:49 PM
<asp:TemplateColumn> <ItemTemplate> <asp:RadioButton id="selectRadioButton" runat="server" GroupName="country" /> </ItemTemplate> </asp:TemplateColumn> but i want to do it in my .cs page...im not sure how to do. Temp...more >>

gridview 2 problems - paging + excel output
Posted by Andrew Nav at 2/7/2006 12:54:40 PM
I have a gridview attached to a sqldatasource. I turned on paging, and Edit and Delete buttons. I ran the app and everything worked great - not a single line of code written yet. Then I wanted to add a simple feature where the user could filter out data based on a value in a single...more >>

date problem
Posted by yoshitha at 2/6/2006 7:16:58 PM
hi db : sql server 2000 lan : C#.net(ASp.Net) in my database table there are 2 fileds of data type datatime. in field 1 i'm storing date in field 2 i'm storing time. in my textbox date is in the format of 2/12/2006 and i'm inserting as it is. and time is in teh fromat of ...more >>

Datagrid UpdateCommand
Posted by Kevin Humphreys at 2/6/2006 12:32:04 PM
Hi, I am having a problem referencing the field that is updated in the datagrid EditCommand event. when i update the text box and trigger the UpdateCommand event the old value still gets populated. below is an example Dim appText As TextBox = CType(e.Item.Cells(2).Controls(0), Text...more >>

Can I insert a CheckBox in design mode?
Posted by Doru Roman at 2/6/2006 11:07:31 AM
HI, I would like to place a CheckBox in the grid and I do not know if it's possible to create and configure it during the design time. Thanks, Doru ...more >>

After Update the grid doesn't show the change
Posted by Doru Roman at 2/6/2006 11:03:52 AM
Hi, I provide the following code for the UpdateCommand event of a grid: TableCell CellCompany = e.Item.Cells[1]; TextBox CompanyBox = (TextBox)CellCompany.Controls[0]; TableCell CellCompID = e.Item.Cells[2]; TextBox CompanyIDBox = (TextBox)CellCompID.Controls[0]; TableCell CellAgency = e.I...more >>

How to get data
Posted by et at 2/4/2006 1:17:01 PM
I am confused on all the ways to access data from a datagrid, so I thank you for any help you can give me. I have a grid with 4 bound columns, and 1 template column with 10 controls. I need to retrieve the data on from a btn that the user clicks on outside of the grid. How do I get the dat...more >>

realignment of datagrid after a search
Posted by dreamz at 2/3/2006 9:06:47 AM
Hello Everybody, i have been trying to solve this problem the entire morning...i have a datagrid (i'm using asp.net with C#) which populates the list of all the users with their details...i have a a search text box and a button ....when i enter a username or the usercode (in the textbox and clic...more >>

Using TextChanged event within DataGrid
Posted by kirkski at 2/3/2006 7:25:23 AM
Hi there, My datagrid contains two text boxes and three dropdownlists - for the purpose of this example I'll name the textboxes TextBox1 and TextBox2. In edit mode there is a requirement to update TextBox2's text to TextBox1 text using the TextChanged event. I trigger the TextChanged event su...more >>

Asp.Net 2.0 GridView inline style: can it be disabled?
Posted by ElSchepo NO[at]SPAM gmail.com at 2/3/2006 6:31:18 AM
Hi, I've got a GridView in my asp.net 2.0 page. After running the page the table tag contains the following attributes: cellspacing="0" rules="all" border="1" id="ID1" style="border-collapse:collapse" Using a skin file asp.net just puts style="blablabla" behind the style content from a...more >>

How to pre-select a control of a DataGrid with the database-result?
Posted by savvy at 2/2/2006 1:56:10 AM
have used MetaBuilders.WebControls for including a radiobutton in a datagrid. Its works fine with retreiving the checked radiobutton datagrid row id. but i'm not able to preselect the row radiobutton which matches with the database data. ok I have a Datagrid which displays CV details created by...more >>

ASP.NET 2.0, GridView, BoundField Visible=False
Posted by KenL at 2/1/2006 7:04:55 PM
Based on the code below using ASP.NET 2.0 GridView server control. When the RefID column Visible="True", then [grd1.Rows(i).Cells(0).Text] = "6". When the RefID column Visible="False", then [grd1.Rows(i).Cells(0).Text] = "" Not the desired result! In ASP.NET 1.1, changing the Visible...more >>

available columns not refreshed after db change
Posted by Tony at 2/1/2006 2:20:23 PM
I added a column and deleted another column from my database table. A data grid is bound to this table through a typed dataset. The xsd file has been updated to the new schema. The data grid is populated correctly from the database. Problem: When I use the "Dataset Properties" dialog from t...more >>

Delete Query for Gridview 2.0
Posted by JN at 2/1/2006 11:25:33 AM
I am using the sqldatasource to populate a gridview and I have a pop up that fires when the item_deleting event is triggered. Now in the popup, if the user clicks cancel, i dont want the delete query to continue. How do I accomplish this? Thanks. JN ...more >>


DevelopmentNow Blog