datagrid hardcoding...

A

Alen Smith

strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

Currently I have hardcoded the first column as Cells(0) value, what is the
syntax to read the column by name. Hard coding like this is causing big
problem for maintenance.

..Net 1.1.

Thanks,

Smith
 
C

Curt_C [MVP]

Alen said:
strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

Currently I have hardcoded the first column as Cells(0) value, what is the
syntax to read the column by name. Hard coding like this is causing big
problem for maintenance.

.Net 1.1.

Thanks,

Smith

Add your value to your DS or View prior to binding it.
 
A

Alen Smith

Curt,

Thanks for the reply.

DS, referring to dataset?

Can you please elaborate on this>

Thanks,

Smith
 
C

Curt_C [MVP]

Alen said:
Curt,

Thanks for the reply.

DS, referring to dataset?

Yup... DataSet
How is your DS getting populated? Look through the calls for a .Add()
 
A

Alen Smith

strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

I am reading from the datagrid first column for iRowCounter.
I am missing some link here. Why you are referring to dataset here?
Thanks,
Smith
 
C

Curt_C [MVP]

Alen said:
strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

I am reading from the datagrid first column for iRowCounter.
I am missing some link here. Why you are referring to dataset here?
Thanks,
Smith

Because you are talking about ADDING to the datagrid causing problem I
though, not READING from it...

If the additional item is added properly then reading it wont be any big
deal.
 
A

Alen Smith

Sometimes the requirements are such that I need to add the column in-between
the existing columns.

If I add like that, I need to recode all the column indexes which are right
side of the newly added column.

What is the meaning of "If the additional item is added properly then
reading it wont be any big deal." How to solve this situation? What is
"properly"

Thanks for replying all questions.

Smith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top