473,322 Members | 1,409 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,322 software developers and data experts.

Datagrid Problem

Dear All,
I have a datagrid which displays the column of Names of doctors.When I
use e.item.cell(5).Text. I see the name of two doctors instead of
one.In
the database the doctors name are:

James,Wilson
Richard,Clark
Jamie,Clark

when I do response.write( e.item.cell(5).Text) in my update event it
outputs the following concated values

James,WilsonRichard,Clark

which I dont want. I want a single name to be appeared

Any help much appreciated.

cheers,
Sunil Sabir
Nov 18 '05 #1
3 1581
Hi Sunil,

Instead of doing a response.write you can put a break point at the place
where you are accessing
e.item.cell(5) and check the value.

if you are still getting 2 names in cell(5) then verify how you are
databinding the Grid column to Data.

if this is also correct then check the SQL Query you have written to get
this data by manually running in Query analyser.

[I guess you have 2 names in DB in that column!]

I know my solution is not the right one but still you can try what i have
told.

Thanks
Raghavendra

"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Dear All,
I have a datagrid which displays the column of Names of doctors.When I use e.item.cell(5).Text. I see the name of two doctors instead of
one.In
the database the doctors name are:

James,Wilson
Richard,Clark
Jamie,Clark

when I do response.write( e.item.cell(5).Text) in my update event it outputs the following concated values

James,WilsonRichard,Clark

which I dont want. I want a single name to be appeared

Any help much appreciated.

cheers,
Sunil Sabir

Nov 18 '05 #2
I believe he meant to insert a "breakpoint" and then run your page in Debug
mode. There you'll be able to check the value.

Are you using Visual Studio or Web Matrix?
- Frank
"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
Hi Raghavendra ,

Thanks for your advice. I used e.item.cell(5).text "<br>". This time its
showing
something like this

James,Wilson
Richard,Clark

I mean it just shows the record on the next line.Before it was showing on the same line. What I need is that It should show only James,Wilson. And one more thing James and Wilson are 2 separated columns in the database. I am concating them first and then retrieving them in the Datagrid

First_Name + ',' + Last_Name

Any help much appreciated.

cheers,
Sunil
"Raghavendra T V" wrote:
Hi Sunil,

Instead of doing a response.write you can put a break point at the place
where you are accessing
e.item.cell(5) and check the value.

if you are still getting 2 names in cell(5) then verify how you are
databinding the Grid column to Data.

if this is also correct then check the SQL Query you have written to get this data by manually running in Query analyser.

[I guess you have 2 names in DB in that column!]

I know my solution is not the right one but still you can try what i have told.

Thanks
Raghavendra

"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Dear All,
I have a datagrid which displays the column of Names of

doctors.When I
use e.item.cell(5).Text. I see the name of two doctors instead of one.In
the database the doctors name are:

James,Wilson
Richard,Clark
Jamie,Clark

when I do response.write( e.item.cell(5).Text) in my update
event it
outputs the following concated values

James,WilsonRichard,Clark

which I dont want. I want a single name to be appeared

Any help much appreciated.

cheers,
Sunil Sabir


Nov 18 '05 #3
you have to use in ItemDataBound as

e.item.cell(5).Text = e.item.dataitem("FirstName") + "<br>" + e.item.dataitem("LastName")
Regards
Ather

"Frank Mamone" <fr**********@canada.com> wrote in message news:O2**************@TK2MSFTNGP15.phx.gbl...
I believe he meant to insert a "breakpoint" and then run your page in Debug
mode. There you'll be able to check the value.

Are you using Visual Studio or Web Matrix?


- Frank


"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
Hi Raghavendra ,

Thanks for your advice. I used e.item.cell(5).text "<br>". This time its
showing
something like this

James,Wilson
Richard,Clark

I mean it just shows the record on the next line.Before it was showing on

the
same line. What I need is that It should show only James,Wilson. And one

more
thing James and Wilson are 2 separated columns in the database. I am

concating
them first and then retrieving them in the Datagrid

First_Name + ',' + Last_Name

Any help much appreciated.

cheers,
Sunil
"Raghavendra T V" wrote:
Hi Sunil,

Instead of doing a response.write you can put a break point at the place
where you are accessing
e.item.cell(5) and check the value.

if you are still getting 2 names in cell(5) then verify how you are
databinding the Grid column to Data.

if this is also correct then check the SQL Query you have written to get this data by manually running in Query analyser.

[I guess you have 2 names in DB in that column!]

I know my solution is not the right one but still you can try what i have told.

Thanks
Raghavendra

"Sunil Sabir" <Su********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
> Dear All,
>
>
> I have a datagrid which displays the column of Names of
doctors.When I
> use e.item.cell(5).Text. I see the name of two doctors instead of > one.In
> the database the doctors name are:
>
> James,Wilson
> Richard,Clark
> Jamie,Clark
>
> when I do response.write( e.item.cell(5).Text) in my update event it
> outputs the following concated values
>
> James,WilsonRichard,Clark
>
> which I dont want. I want a single name to be appeared
>
> Any help much appreciated.
>
> cheers,
> Sunil Sabir


Nov 18 '05 #4

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

Similar topics

2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.