473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Adding separator to datagrid

I am having one datagrid in my page where the user will enter some
information and that information is saved into database.I am adding
separators to my datagrid rows in the pre render event of the
datagrid.It is displaying the separators properly in the web page.

In the save button click, I am looping through the datagrid items and
then saving the values in the database after checking the itemtype of
the rows .The issue is, the separator replaces the actual row at the
specified index and I am getting exception when trying to access the
item values. Not only that, if I check the itemType ,it is giving me
as Item instead of separator.

If anyone shed light on this it will be relief for me.

Mar 23 '07 #1
1 3810

<Ar**********@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
>I am having one datagrid in my page where the user will enter some
information and that information is saved into database.I am adding
separators to my datagrid rows in the pre render event of the
datagrid.It is displaying the separators properly in the web page.

In the save button click, I am looping through the datagrid items and
then saving the values in the database after checking the itemtype of
the rows .The issue is, the separator replaces the actual row at the
specified index and I am getting exception when trying to access the
item values. Not only that, if I check the itemType ,it is giving me
as Item instead of separator.
Can you post here a code of the pre render event?

According to MS the ListItemType.Separator should work
http://msdn2.microsoft.com/en-us/lib....datagrid.aspx
Mar 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jim | last post by:
In my Win App, I have a datagrid that's bound to a dataset. When the form loads, the datagrid fills. How can I add an empty row to the end of the datagrid during a button click (similar to...
1
by: Mike Malter | last post by:
I take it that the only way to add rows to a DataList control is through DataBind? If not, how do I manually add rows to a DataList control? I have searched everywhere and can't find an example...
2
by: Clayton Hamilton | last post by:
I have a DataGrid on a webform bound to a Datasource and can successfully use <ItemTemplate> to create edit/update/cancel functionality for user maintenance of data. I use separate logic to delete...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
3
by: Barbara Alderton | last post by:
I recently wrote an ASP.NET app that used user controls. I produced a printer-friendly output form. One requirement was a pagebreak between one part of the form and another. I had no problem...
0
by: mcrowell | last post by:
Here's my code: DataGridItem row = new DataGridItem(-1, -1, ListItemType.Separator); TableCell cell = new TableCell(); row.Cells.Add(cell); cell = new TableCell(); cell.Text = "New Header";...
3
by: Fao, Sean | last post by:
I have a DataGrid that I'm adding CheckBox controls to at runtime (in the code behind) and I'm not sure if I'm doing it correctly. First of all, I noticed that the MyDataGrid.Columns.Add() method...
1
by: Jose | last post by:
Please how shows the vertical column separator line in a datagrid? Thanks a lot
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.