473,508 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagrid hardcoding...

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


Nov 19 '05 #1
6 1011
Alen Smith wrote:
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
Curt,

Thanks for the reply.

DS, referring to dataset?

Can you please elaborate on this>

Thanks,

Smith
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Alen Smith wrote:
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #3
Alen Smith wrote:
Curt,

Thanks for the reply.

DS, referring to dataset?


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

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #4
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
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
Alen Smith wrote:
Curt,

Thanks for the reply.

DS, referring to dataset?


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

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #5
Alen Smith wrote:
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #6
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

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:eV**************@TK2MSFTNGP14.phx.gbl...
Alen Smith wrote:
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #7

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

Similar topics

3
4481
by: Rob | last post by:
You can find datagrid in page by refering the form. Gatagrid is a child control of Form. Here is the code ----------------- Dim ctl As New Control For Each ctl In...
8
2656
by: AngryGerbil | last post by:
hey, How do I acquire MethodInfo WITHOUT hardcoding method name as a string?!??!The fact I have to use xxx.Gettype.GetMethod("MyMethod", xxx) is making me want to drive an ice pick into my eye! I...
5
2212
by: lanem | last post by:
I want to display some drill-down data with a datagrid look. I can get the exact functionality I want with a treeview, but I don't like the way the treeview looks and formats the data. I want a...
0
1237
by: Sridhar | last post by:
Hi, I have a datagrid which contains some bound columns, some template columns. The template columns contain text box in one column, Hyperlink column in other column, dropdownlist in another...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.